Client

Struct Client 

Source
pub struct Client<R>
where R: Reactor,
{ /* private fields */ }
Expand description

A light-client process.

Implementations§

Source§

impl<R> Client<R>
where R: Reactor,

Source

pub fn new() -> Result<Client<R>, Error>

Create a new client.

Source

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.

Source

pub fn run(self, config: Config) -> Result<(), Error>

Start the client process. This function is meant to be run in its own thread.

Source

pub fn run_service<T>( self, listen: &[SocketAddr], service: T, ) -> Result<(), Error>
where T: Service<Event = Event, Command = Command>,

Start the client process, supplying the service manually. This function is meant to be run in its own thread.

Source

pub fn handle(&self) -> Handle<<R as Reactor>::Waker>

Create a new handle to communicate with the client.

Auto Trait Implementations§

§

impl<R> Freeze for Client<R>
where R: Freeze, <R as Reactor>::Waker: Freeze,

§

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>::Waker: Unpin,

§

impl<R> !UnwindSafe for Client<R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.