pub struct JetstreamConnector { /* private fields */ }Expand description
A wrapper connector type for working with a WebSocket connection to a Jetstream instance to receive and consume events. See JetstreamConnector::connect for more info.
Implementations§
Source§impl JetstreamConnector
impl JetstreamConnector
Sourcepub fn new(config: JetstreamConfig) -> Result<Self, ConfigValidationError>
pub fn new(config: JetstreamConfig) -> Result<Self, ConfigValidationError>
Create a Jetstream connector with a valid JetstreamConfig.
After creation, you can call [connect] to connect to the provided Jetstream instance.
Sourcepub async fn connect(&self) -> Result<JetstreamReceiver, ConnectionError>
pub async fn connect(&self) -> Result<JetstreamReceiver, ConnectionError>
Connects to a Jetstream instance as defined in the JetstreamConfig.
A JetstreamReceiver is returned which can be used to respond to events. When all instances of this receiver are dropped, the connection and task are automatically closed.
Auto Trait Implementations§
impl Freeze for JetstreamConnector
impl RefUnwindSafe for JetstreamConnector
impl Send for JetstreamConnector
impl Sync for JetstreamConnector
impl Unpin for JetstreamConnector
impl UnwindSafe for JetstreamConnector
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