pub struct NodeKeys {
pub secret: HashBytes,
}Fields§
§secret: HashBytesImplementations§
Source§impl NodeKeys
impl NodeKeys
pub fn generate() -> Self
Sourcepub fn load_or_create<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn load_or_create<P: AsRef<Path>>(path: P) -> Result<Self>
Tries to load keys from the specified path.
Generates and saves new keys if the file doesn’t exist.
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn save_to_file<P: AsRef<Path>>(&self, path: P) -> Result<()>
pub fn as_secret(&self) -> SecretKey
pub fn public_key(&self) -> PublicKey
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeKeys
impl<'de> Deserialize<'de> for NodeKeys
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
Source§impl Distribution<NodeKeys> for StandardUniform
impl Distribution<NodeKeys> for StandardUniform
Auto Trait Implementations§
impl Freeze for NodeKeys
impl RefUnwindSafe for NodeKeys
impl Send for NodeKeys
impl Sync for NodeKeys
impl Unpin for NodeKeys
impl UnwindSafe for NodeKeys
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more