pub struct BnExecutor { /* private fields */ }Implementations§
Source§impl BnExecutor
impl BnExecutor
Sourcepub fn builder() -> BnExecutorBuilder<((), (), (), (), (), ())>
pub fn builder() -> BnExecutorBuilder<((), (), (), (), (), ())>
Create a builder for building BnExecutor.
On the builder, call .endpoint(...), .rest_client(...)(optional), .signer(...)(optional), .ratelimiter(...)(optional), .ws_api(...)(optional), .streams(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of BnExecutor.
Source§impl BnExecutor
impl BnExecutor
pub fn get_endpoint(&self) -> &BnEndpoint
pub async fn call_ws_api<ReqType: Serialize, ResType: DeserializeOwned>( &self, limits: &[(BnRateLimitType, NonZeroU32)], signed: bool, method: &str, params: Option<ReqType>, ) -> BnWsApiRespType<ResType>
pub async fn subscribe_stream<T: DeserializeOwned + Send + 'static>( &self, stream: String, ) -> Result<Receiver<Result<T, SharedWsError>>, SharedWsError>
Trait Implementations§
fn get_client(&self) -> &Client
fn get_signer(&self) -> &dyn SharedSignerTrait
fn get_ratelimiter( &self, ) -> Arc<dyn SharedRatelimiterTrait<BnRateLimitType> + Sync + Send>
fn call_with_no_payload<'life0, 'life1, 'async_trait, ResponseType, Err>(
&'life0 self,
limits: &'life1 [(RateLimitType, NonZero<u32>)],
signed: bool,
method: Method,
url: Url,
) -> Pin<Box<dyn Future<Output = Result<ResponseType, SharedRestError<Err>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ResponseType: 'async_trait + SharedRestResponseTrait,
Err: 'async_trait + SharedRestClientErrorTrait,
Self: Sync + 'async_trait,
fn call_with_no_response<'life0, 'life1, 'life2, 'async_trait, PayloadType, Err>(
&'life0 self,
limits: &'life1 [(RateLimitType, NonZero<u32>)],
signed: bool,
method: Method,
url: Url,
payload: Option<&'life2 PayloadType>,
) -> Pin<Box<dyn Future<Output = Result<(), SharedRestError<Err>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
PayloadType: 'async_trait + Sync + Send + SharedRestPayloadTrait,
Err: 'async_trait + SharedRestClientErrorTrait,
Self: Sync + 'async_trait,
fn call_with_no_payload_and_response<'life0, 'life1, 'async_trait, Err>(
&'life0 self,
limits: &'life1 [(RateLimitType, NonZero<u32>)],
signed: bool,
method: Method,
url: Url,
) -> Pin<Box<dyn Future<Output = Result<(), SharedRestError<Err>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Err: 'async_trait + SharedRestClientErrorTrait,
Self: Sync + 'async_trait,
fn call<'life0, 'life1, 'life2, 'async_trait, PayloadType, ResponseType, Err>(
&'life0 self,
limits: &'life1 [(RateLimitType, NonZero<u32>)],
signed: bool,
method: Method,
url: Url,
payload: Option<&'life2 PayloadType>,
) -> Pin<Box<dyn Future<Output = Result<ResponseType, SharedRestError<Err>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
PayloadType: 'async_trait + Sync + Send + SharedRestPayloadTrait,
ResponseType: 'async_trait + SharedRestResponseTrait,
Err: 'async_trait + SharedRestClientErrorTrait,
Self: Sync + 'async_trait,
Auto Trait Implementations§
impl !Freeze for BnExecutor
impl !RefUnwindSafe for BnExecutor
impl Send for BnExecutor
impl Sync for BnExecutor
impl Unpin for BnExecutor
impl !UnwindSafe for BnExecutor
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