Struct sequoia_openpgp::packet::signature::subpacket::NotationDataFlags
source · [−]pub struct NotationDataFlags(_);
Expand description
Flags for the Notation Data subpacket.
Implementations
sourceimpl 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
sourceimpl Clone for NotationDataFlags
impl Clone for NotationDataFlags
sourcefn clone(&self) -> NotationDataFlags
fn clone(&self) -> NotationDataFlags
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for NotationDataFlags
impl Debug for NotationDataFlags
sourceimpl Hash for NotationDataFlags
impl Hash for NotationDataFlags
sourceimpl Ord for NotationDataFlags
impl Ord for NotationDataFlags
sourceimpl PartialEq<NotationDataFlags> for NotationDataFlags
impl PartialEq<NotationDataFlags> for NotationDataFlags
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &NotationDataFlags) -> bool
fn ne(&self, other: &NotationDataFlags) -> bool
This method tests for !=
.
sourceimpl PartialOrd<NotationDataFlags> for NotationDataFlags
impl PartialOrd<NotationDataFlags> for NotationDataFlags
sourcefn partial_cmp(&self, other: &NotationDataFlags) -> Option<Ordering>
fn partial_cmp(&self, other: &NotationDataFlags) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl Eq for NotationDataFlags
impl StructuralEq for NotationDataFlags
impl StructuralPartialEq for NotationDataFlags
Auto Trait Implementations
impl RefUnwindSafe for NotationDataFlags
impl Send for NotationDataFlags
impl Sync for NotationDataFlags
impl Unpin for NotationDataFlags
impl UnwindSafe for NotationDataFlags
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more