pub struct Identity {
pub keypair: Keypair,
pub peer_id: PeerId,
}Fields§
§keypair: KeypairLong-term Ed25519 identity keypair.
peer_id: PeerIdStable peer identifier derived from the public key.
Implementations§
Source§impl Identity
impl Identity
Sourcepub fn generate_from_keypair(keypair: Keypair) -> Self
pub fn generate_from_keypair(keypair: Keypair) -> Self
Wrap an existing keypair and derive its peer id.
Sourcepub fn default_path() -> Result<PathBuf, CoreError>
pub fn default_path() -> Result<PathBuf, CoreError>
Default on-disk identity path on native targets.
Sourcepub fn load(path: Option<&Path>) -> Result<Self, CoreError>
pub fn load(path: Option<&Path>) -> Result<Self, CoreError>
Load an identity from disk or return a detailed error.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Identity
impl RefUnwindSafe for Identity
impl Send for Identity
impl Sync for Identity
impl Unpin 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