pub struct Client { /* private fields */ }
Expand description
A Client
is the entity used by clients of this module for
interacting with the Polygon API.
Implementations§
Source§impl Client
impl Client
Sourcepub fn from_env() -> Result<Self, Error>
pub fn from_env() -> Result<Self, Error>
Create a new Client
with information from the environment.
Sourcepub async fn issue<E>(
&self,
input: E::Input,
) -> Result<E::Output, RequestError<E::Error>>where
E: Endpoint,
pub async fn issue<E>(
&self,
input: E::Input,
) -> Result<E::Output, RequestError<E::Error>>where
E: Endpoint,
Create and issue a request and decode the response.
Sourcepub async fn subscribe<S>(
&self,
subscriptions: S,
) -> Result<impl Stream<Item = Result<Result<Event, JsonError>, WebSocketError>>, Error>where
S: IntoIterator<Item = Subscription>,
pub async fn subscribe<S>(
&self,
subscriptions: S,
) -> Result<impl Stream<Item = Result<Result<Event, JsonError>, WebSocketError>>, Error>where
S: IntoIterator<Item = Subscription>,
Subscribe to the given stream in order to receive updates.
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