pub struct WebcashServerClient { /* private fields */ }Expand description
Webcash server client (Clone shares connection pool)
Implementations§
Source§impl ServerClient
impl ServerClient
Sourcepub fn new() -> Result<ServerClient, Error>
pub fn new() -> Result<ServerClient, Error>
Create a new server client with default configuration
Sourcepub fn with_config(config: ServerConfig) -> Result<ServerClient, Error>
pub fn with_config(config: ServerConfig) -> Result<ServerClient, Error>
Create a new server client with custom configuration
Sourcepub async fn health_check(
&self,
webcash: &[PublicWebcash],
) -> Result<HealthResponse, Error>
pub async fn health_check( &self, webcash: &[PublicWebcash], ) -> Result<HealthResponse, Error>
Check the health status of webcash entries
Sourcepub async fn replace(
&self,
request: &ReplaceRequest,
) -> Result<ReplaceResponse, Error>
pub async fn replace( &self, request: &ReplaceRequest, ) -> Result<ReplaceResponse, Error>
Submit a replacement request to the server
Sourcepub async fn get_target(&self) -> Result<TargetResponse, Error>
pub async fn get_target(&self) -> Result<TargetResponse, Error>
Get current mining target information
Sourcepub async fn submit_mining_report(
&self,
report: &MiningReportRequest,
) -> Result<MiningReportResponse, Error>
pub async fn submit_mining_report( &self, report: &MiningReportRequest, ) -> Result<MiningReportResponse, Error>
Submit a mining report
Trait Implementations§
Source§impl Clone for ServerClient
impl Clone for ServerClient
Source§fn clone(&self) -> ServerClient
fn clone(&self) -> ServerClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ServerClientTrait for ServerClient
impl ServerClientTrait for ServerClient
fn health_check<'life0, 'life1, 'async_trait>(
&'life0 self,
webcash: &'life1 [PublicWebcash],
) -> Pin<Box<dyn Future<Output = Result<HealthResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ServerClient: 'async_trait,
fn replace<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ReplaceRequest,
) -> Pin<Box<dyn Future<Output = Result<ReplaceResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ServerClient: 'async_trait,
fn get_target<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<TargetResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
ServerClient: 'async_trait,
fn submit_mining_report<'life0, 'life1, 'async_trait>(
&'life0 self,
report: &'life1 MiningReportRequest,
) -> Pin<Box<dyn Future<Output = Result<MiningReportResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ServerClient: 'async_trait,
Auto Trait Implementations§
impl Freeze for ServerClient
impl !RefUnwindSafe for ServerClient
impl Send for ServerClient
impl Sync for ServerClient
impl Unpin for ServerClient
impl UnsafeUnpin for ServerClient
impl !UnwindSafe for ServerClient
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
Attempts to downcast this to
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
Attempts to downcast this to
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
Attempts to downcast this to
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
Attempts to downcast this to
T behind Arc pointerSource§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<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request