pub struct LocalNode { /* private fields */ }Expand description
Represents the local Node being run in the current process. Contrarily to
other nodes, we have a full private+public keypair that we can sign messages
with.
Implementations§
Source§impl LocalNode
impl LocalNode
pub fn from_config( dir: impl Into<DynDirectory>, config: LocalNodeConfig, ) -> Result<LocalNode, Error>
pub fn generate() -> LocalNode
pub fn generate_in_directory( dir: impl Into<DynDirectory>, ) -> Result<LocalNode, Error>
pub fn from_directory(dir: impl Into<DynDirectory>) -> Result<LocalNode, Error>
pub fn directory(&self) -> &DynDirectory
pub fn cell_directory(&self, cell_id: &CellId) -> DynDirectory
pub fn node(&self) -> &Node
pub fn keypair(&self) -> &Keypair
pub fn sign_message(&self, _message: &[u8]) -> Signature
pub fn config(&self) -> &LocalNodeConfig
pub fn inlined_config(&self) -> Result<LocalNodeConfig, Error>
pub fn save_config(&self, config: &LocalNodeConfig) -> Result<(), Error>
pub fn p2p_listen_addresses(&self) -> Vec<Multiaddr>
pub fn http_listen_addresses(&self) -> Vec<Url>
pub fn config_exists(dir: impl Into<DynDirectory>) -> bool
Methods from Deref<Target = Node>§
pub fn id(&self) -> &NodeId
pub fn public_key(&self) -> &PublicKey
pub fn peer_id(&self) -> &PeerId
pub fn name(&self) -> &str
pub fn consistent_clock_id(&self) -> u16
pub fn p2p_addresses(&self) -> Vec<Multiaddr>
pub fn add_p2p_address(&self, address: Multiaddr)
pub fn http_addresses(&self) -> Vec<Url>
pub fn add_http_address(&self, address: Url)
Trait Implementations§
impl Eq for LocalNode
Auto Trait Implementations§
impl Freeze for LocalNode
impl !RefUnwindSafe for LocalNode
impl Send for LocalNode
impl Sync for LocalNode
impl Unpin for LocalNode
impl !UnwindSafe for LocalNode
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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