Skip to main content

Uid

Struct Uid 

Source
pub struct Uid<'key> { /* private fields */ }
Expand description

Borrowed handle to a user ID on a Key.

Borrows the key for at most its lifetime. Destroyed on drop via rnp_uid_handle_destroy.

Implementations§

Source§

impl<'key> Uid<'key>

Source

pub fn uid_type(&self) -> Result<UidType>

The UID type — textual or attribute.

Source

pub fn data(&self) -> Result<Vec<u8>>

The raw UID bytes. For textual UIDs this is the UTF-8 string; for attributes it’s the attribute data.

Source

pub fn data_string(&self) -> Result<String>

The UID as a UTF-8 string. Lossy for non-UTF-8 bytes.

Source

pub fn is_primary(&self) -> Result<bool>

True if this UID is marked as the primary UID on the key.

Source

pub fn is_valid(&self) -> Result<bool>

True if the UID is currently valid (not revoked, on a valid key, etc.).

Source

pub fn is_revoked(&self) -> Result<bool>

True if the UID has been revoked.

Source

pub fn signature_count(&self) -> Result<usize>

Number of signatures on this UID (self-signatures and third-party certifications).

Source

pub fn signature_at(&self, idx: usize) -> Result<Option<Signature<'_>>>

Borrow the signature at idx on this UID. Returned Signature borrows self.

Source

pub fn signatures(&self) -> Result<Vec<Signature<'_>>>

All signatures on this UID.

Source

pub fn revocation_signature(&self) -> Result<Option<Signature<'_>>>

The UID’s revocation signature, if the UID has been revoked.

Source

pub fn remove(&self, key: &Key<'_>) -> Result<()>

Remove this UID from its parent key. Wraps rnp_uid_remove(key, uid).

Trait Implementations§

Source§

impl<'key> Drop for Uid<'key>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'key> !RefUnwindSafe for Uid<'key>

§

impl<'key> !Send for Uid<'key>

§

impl<'key> !Sync for Uid<'key>

§

impl<'key> !UnwindSafe for Uid<'key>

§

impl<'key> Freeze for Uid<'key>

§

impl<'key> Unpin for Uid<'key>

§

impl<'key> UnsafeUnpin for Uid<'key>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.