Struct nakamoto_node::Client
source · pub struct Client<R>where
R: Reactor<SocketAddr>,{ /* private fields */ }
Expand description
A light-client process.
Implementations
sourceimpl<R> Client<R>where
R: Reactor<SocketAddr>,
impl<R> Client<R>where
R: Reactor<SocketAddr>,
sourcepub fn load(
self,
config: Config,
loading: impl Into<LoadingHandler>
) -> Result<ClientRunner<R>, Error>
pub fn load(
self,
config: Config,
loading: impl Into<LoadingHandler>
) -> Result<ClientRunner<R>, Error>
Load the client configuration. Takes a loading handler that can optionally receive loading events.
sourcepub fn run(self, config: Config) -> Result<(), Error>
pub fn run(self, config: Config) -> Result<(), Error>
Start the client process. This function is meant to be run in its own thread.
sourcepub fn run_service<T>(
self,
listen: &[SocketAddr],
service: T
) -> Result<(), Error>where
T: Service<SocketAddr, Event = Event, Command = Command>,
pub fn run_service<T>(
self,
listen: &[SocketAddr],
service: T
) -> Result<(), Error>where
T: Service<SocketAddr, Event = Event, Command = Command>,
Start the client process, supplying the service manually. This function is meant to be run in its own thread.
sourcepub fn handle(&self) -> Handle<<R as Reactor<SocketAddr>>::Waker>
pub fn handle(&self) -> Handle<<R as Reactor<SocketAddr>>::Waker>
Create a new handle to communicate with the client.
Auto Trait Implementations
impl<R> !RefUnwindSafe for Client<R>
impl<R> Send for Client<R>where
R: Send,
impl<R> Sync for Client<R>where
R: Sync,
impl<R> Unpin for Client<R>where
R: Unpin,
<R as Reactor<SocketAddr>>::Waker: Unpin,
impl<R> !UnwindSafe for Client<R>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more