[−][src]Struct nakamoto_node::node::NodeHandle
Implementations
impl NodeHandle[src]
pub fn set_timeout(&mut self, timeout: Duration)[src]
Set the timeout for operations that wait on the network.
pub fn command(&self, cmd: Command) -> Result<(), Error>[src]
Send a command to the command channel, and wake up the event loop.
Trait Implementations
impl Handle for NodeHandle[src]
type Message = NetworkMessage
The message payload exchanged between nodes in the network.
type Event = Event<NetworkMessage>
Node event generated during protocol operation.
fn get_tip(&self) -> Result<BlockHeader, Error>[src]
fn get_block(&self, hash: &BlockHash) -> Result<Block, Error>[src]
fn connect(&self, addr: SocketAddr) -> Result<Link, Error>[src]
fn import_headers(
&self,
headers: Vec<BlockHeader>
) -> Result<Result<ImportResult, Error>, Error>[src]
&self,
headers: Vec<BlockHeader>
) -> Result<Result<ImportResult, Error>, Error>
fn receive(&self, from: SocketAddr, msg: NetworkMessage) -> Result<(), Error>[src]
fn submit_transaction(&self, _tx: Transaction) -> Result<(), Error>[src]
fn wait<F, T>(&self, f: F) -> Result<T, Error> where
F: Fn(Event<NetworkMessage>) -> Option<T>, [src]
F: Fn(Event<NetworkMessage>) -> Option<T>,
Subscribe to the event feed, and wait for the given function to return something, or timeout if the specified amount of time has elapsed.
fn wait_for_peers(&self, count: usize) -> Result<(), Error>[src]
fn wait_for_ready(&self) -> Result<(), Error>[src]
fn wait_for_height(&self, h: Height) -> Result<BlockHash, Error>[src]
fn shutdown(self) -> Result<(), Error>[src]
Auto Trait Implementations
impl RefUnwindSafe for NodeHandle
impl Send for NodeHandle
impl Sync for NodeHandle
impl Unpin for NodeHandle
impl UnwindSafe for NodeHandle
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,