pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
Sourcepub async fn request(&mut self, rk: RequestKind) -> Result<ResponseKind, Error>
pub async fn request(&mut self, rk: RequestKind) -> Result<ResponseKind, Error>
Issue a request to the daemon using a client instance, returning a response
Sourcepub async fn status(&mut self) -> Result<StatusInfo, Error>
pub async fn status(&mut self) -> Result<StatusInfo, Error>
Fetch daemon status information
Sourcepub async fn connect(
&mut self,
options: ConnectOptions,
) -> Result<ConnectInfo, Error>
pub async fn connect( &mut self, options: ConnectOptions, ) -> Result<ConnectInfo, Error>
Connect to another DSF instance
Sourcepub async fn find(&mut self, options: SearchOptions) -> Result<PeerInfo, Error>
pub async fn find(&mut self, options: SearchOptions) -> Result<PeerInfo, Error>
Search for a peer using the database
Sourcepub async fn list(
&mut self,
options: ListOptions,
) -> Result<Vec<ServiceInfo>, Error>
pub async fn list( &mut self, options: ListOptions, ) -> Result<Vec<ServiceInfo>, Error>
List known services
Sourcepub async fn info(
&mut self,
options: InfoOptions,
) -> Result<(ServiceHandle, ServiceInfo), Error>
pub async fn info( &mut self, options: InfoOptions, ) -> Result<(ServiceHandle, ServiceInfo), Error>
Fetch information for a given service
Sourcepub async fn create(
&mut self,
options: CreateOptions,
) -> Result<ServiceHandle, Error>
pub async fn create( &mut self, options: CreateOptions, ) -> Result<ServiceHandle, Error>
Create a new service with the provided options This MUST be stored locally for reuse
Sourcepub async fn register(
&mut self,
options: RegisterOptions,
) -> Result<RegisterInfo, Error>
pub async fn register( &mut self, options: RegisterOptions, ) -> Result<RegisterInfo, Error>
Register a service instance in the distributed database
Sourcepub async fn locate(
&mut self,
options: LocateOptions,
) -> Result<(ServiceHandle, LocateInfo), Error>
pub async fn locate( &mut self, options: LocateOptions, ) -> Result<(ServiceHandle, LocateInfo), Error>
Locate a service instance in the distributed database This returns a future that will resolve to the desired service or an error
Sourcepub async fn publish(
&mut self,
options: PublishOptions,
) -> Result<PublishInfo, Error>
pub async fn publish( &mut self, options: PublishOptions, ) -> Result<PublishInfo, Error>
Publish data using an existing service
Sourcepub async fn subscribe(
&mut self,
options: SubscribeOptions,
) -> Result<impl Stream<Item = ResponseKind>, Error>
pub async fn subscribe( &mut self, options: SubscribeOptions, ) -> Result<impl Stream<Item = ResponseKind>, Error>
Subscribe to data from a given service
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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> 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> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
Convert
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
Convert
&self to an expression for Diesel’s query builder. Read more