pub struct Identity {
pub peer_id: String,
pub priv_key: Option<String>,
}Expand description
Identity configuration section
Fields§
§peer_id: StringThe peer ID (base58 or base36 encoded)
priv_key: Option<String>The private key (base64 encoded protobuf)
Implementations§
Source§impl Identity
impl Identity
Sourcepub fn with_private_key(peer_id: String, priv_key: String) -> Self
pub fn with_private_key(peer_id: String, priv_key: String) -> Self
Create a new identity with peer ID and private key
Sourcepub fn has_private_key(&self) -> bool
pub fn has_private_key(&self) -> bool
Check if the identity has a private key
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Identity
impl<'de> Deserialize<'de> for Identity
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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