pub struct Subscription {
pub stream: String,
pub symbol: String,
pub sub_type: SubscriptionType,
pub subscribed_at: Instant,
pub sender: UnboundedSender<Value>,
}Expand description
Subscription metadata
Fields§
§stream: StringStream name (e.g. “btcusdt@ticker”)
symbol: StringNormalized trading symbol (e.g. “BTCUSDT”)
sub_type: SubscriptionTypeSubscription type descriptor
subscribed_at: InstantTimestamp when the subscription was created
sender: UnboundedSender<Value>Sender for forwarding WebSocket messages to consumers
Implementations§
Source§impl Subscription
impl Subscription
Sourcepub fn new(
stream: String,
symbol: String,
sub_type: SubscriptionType,
sender: UnboundedSender<Value>,
) -> Self
pub fn new( stream: String, symbol: String, sub_type: SubscriptionType, sender: UnboundedSender<Value>, ) -> Self
Creates a new subscription with the provided parameters
Trait Implementations§
Source§impl Clone for Subscription
impl Clone for Subscription
Source§fn clone(&self) -> Subscription
fn clone(&self) -> Subscription
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Subscription
impl RefUnwindSafe for Subscription
impl Send for Subscription
impl Sync for Subscription
impl Unpin for Subscription
impl UnwindSafe for Subscription
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