pub struct Identity { /* private fields */ }Expand description
The local node’s identity, kept current.
Cheap to clone and shared between clones, so that one refresh serves every handler rather than each holding its own idea of who we are.
Implementations§
Source§impl Identity
impl Identity
Sourcepub fn probed(known: SelfIdentity) -> Self
pub fn probed(known: SelfIdentity) -> Self
An identity that was read from status and may be read again.
Sourcepub fn fixed(known: SelfIdentity) -> Self
pub fn fixed(known: SelfIdentity) -> Self
An identity fixed at what it was given: what tests and a session with no local surface get.
Sourcepub fn last_known(&self) -> SelfIdentity
pub fn last_known(&self) -> SelfIdentity
The last reading, without asking for a new one.
For the places that run once at startup and would gain nothing from a refresh, such as the instructions.
Trait Implementations§
Source§impl From<SelfIdentity> for Identity
impl From<SelfIdentity> for Identity
Source§fn from(known: SelfIdentity) -> Self
fn from(known: SelfIdentity) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Identity
impl RefUnwindSafe for Identity
impl Send for Identity
impl Sync for Identity
impl Unpin for Identity
impl UnsafeUnpin for Identity
impl UnwindSafe for Identity
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