Struct sequoia_openpgp::packet::signature::subpacket::NotationDataFlags
source · pub struct NotationDataFlags(/* private fields */);
Expand description
Flags for the Notation Data subpacket.
Implementations§
source§impl NotationDataFlags
impl NotationDataFlags
sourcepub fn as_bitfield(&self) -> &Bitfield
pub fn as_bitfield(&self) -> &Bitfield
Returns a reference to the underlying
Bitfield
.
sourcepub fn get(&self, bit: usize) -> bool
pub fn get(&self, bit: usize) -> bool
Returns whether the specified notation data flag is set.
§Examples
use sequoia_openpgp as openpgp;
use openpgp::packet::signature::subpacket::NotationDataFlags;
// Notation Data flags 0 and 2.
let ndf = NotationDataFlags::new(&[5, 0, 0, 0])?;
assert!(ndf.get(0));
assert!(! ndf.get(1));
assert!(ndf.get(2));
assert!(! ndf.get(3));
assert!(! ndf.get(8));
assert!(! ndf.get(80));
sourcepub fn set(self, bit: usize) -> Result<Self>
pub fn set(self, bit: usize) -> Result<Self>
Sets the specified notation data flag.
§Examples
use sequoia_openpgp as openpgp;
use openpgp::packet::signature::subpacket::NotationDataFlags;
let ndf = NotationDataFlags::empty().set(0)?.set(2)?;
assert!(ndf.get(0));
assert!(! ndf.get(1));
assert!(ndf.get(2));
assert!(! ndf.get(3));
sourcepub fn clear(self, bit: usize) -> Result<Self>
pub fn clear(self, bit: usize) -> Result<Self>
Clears the specified notation data flag.
§Examples
use sequoia_openpgp as openpgp;
use openpgp::packet::signature::subpacket::NotationDataFlags;
let ndf = NotationDataFlags::empty().set(0)?.set(2)?.clear(2)?;
assert!(ndf.get(0));
assert!(! ndf.get(1));
assert!(! ndf.get(2));
assert!(! ndf.get(3));
sourcepub fn human_readable(&self) -> bool
pub fn human_readable(&self) -> bool
Returns whether the value is human-readable.
sourcepub fn set_human_readable(self) -> Self
pub fn set_human_readable(self) -> Self
Asserts that the value is human-readable.
sourcepub fn clear_human_readable(self) -> Self
pub fn clear_human_readable(self) -> Self
Clear the assertion that the value is human-readable.
Trait Implementations§
source§impl Clone for NotationDataFlags
impl Clone for NotationDataFlags
source§fn clone(&self) -> NotationDataFlags
fn clone(&self) -> NotationDataFlags
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for NotationDataFlags
impl Debug for NotationDataFlags
source§impl Hash for NotationDataFlags
impl Hash for NotationDataFlags
source§impl Ord for NotationDataFlags
impl Ord for NotationDataFlags
source§fn cmp(&self, other: &NotationDataFlags) -> Ordering
fn cmp(&self, other: &NotationDataFlags) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for NotationDataFlags
impl PartialEq for NotationDataFlags
source§fn eq(&self, other: &NotationDataFlags) -> bool
fn eq(&self, other: &NotationDataFlags) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for NotationDataFlags
impl PartialOrd for NotationDataFlags
source§fn partial_cmp(&self, other: &NotationDataFlags) -> Option<Ordering>
fn partial_cmp(&self, other: &NotationDataFlags) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for NotationDataFlags
impl StructuralPartialEq for NotationDataFlags
Auto Trait Implementations§
impl Freeze for NotationDataFlags
impl RefUnwindSafe for NotationDataFlags
impl Send for NotationDataFlags
impl Sync for NotationDataFlags
impl Unpin for NotationDataFlags
impl UnwindSafe for NotationDataFlags
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)