pub struct StreamSpec {
pub kind: StreamKind,
pub symbol: OwnedSymbolInput,
pub account_type: AccountType,
pub depth: Option<u32>,
pub speed_ms: Option<u32>,
}Expand description
Internal subscription specification used by UniversalWsTransport.
Converted from SubscriptionRequest at subscribe() time.
symbol holds either a raw exchange-native string (e.g. "BTCUSDT" for
Binance) or a canonical Symbol that is resolved to exchange-native via
StreamSpec::resolve_symbol before building the subscribe frame.
Fields§
§kind: StreamKind§symbol: OwnedSymbolInputSymbol input — raw exchange-native or canonical (resolved on use).
account_type: AccountType§depth: Option<u32>Depth hint for orderbook channels. None = exchange default.
speed_ms: Option<u32>Speed hint in ms. None = exchange default.
Implementations§
Source§impl StreamSpec
impl StreamSpec
Sourcepub fn resolve_symbol(
&self,
exchange: ExchangeId,
account_type: AccountType,
) -> Result<String, NormalizerError>
pub fn resolve_symbol( &self, exchange: ExchangeId, account_type: AccountType, ) -> Result<String, NormalizerError>
Resolve symbol to an exchange-native owned String.
OwnedSymbolInput::Raw(s)→ cloness.OwnedSymbolInput::Canonical(sym)→ normalizes via [SymbolNormalizer].
Trait Implementations§
Source§impl Clone for StreamSpec
impl Clone for StreamSpec
Source§fn clone(&self) -> StreamSpec
fn clone(&self) -> StreamSpec
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 Debug for StreamSpec
impl Debug for StreamSpec
impl Eq for StreamSpec
Source§impl From<StreamSpec> for SubscriptionRequest
impl From<StreamSpec> for SubscriptionRequest
Source§fn from(spec: StreamSpec) -> Self
fn from(spec: StreamSpec) -> Self
Converts to this type from the input type.
Source§impl Hash for StreamSpec
impl Hash for StreamSpec
Source§impl PartialEq for StreamSpec
impl PartialEq for StreamSpec
Source§fn eq(&self, other: &StreamSpec) -> bool
fn eq(&self, other: &StreamSpec) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for StreamSpec
Source§impl TryFrom<SubscriptionRequest> for StreamSpec
impl TryFrom<SubscriptionRequest> for StreamSpec
Source§type Error = WebSocketError
type Error = WebSocketError
The type returned in the event of a conversion error.
Source§fn try_from(req: SubscriptionRequest) -> WebSocketResult<Self>
fn try_from(req: SubscriptionRequest) -> WebSocketResult<Self>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for StreamSpec
impl RefUnwindSafe for StreamSpec
impl Send for StreamSpec
impl Sync for StreamSpec
impl Unpin for StreamSpec
impl UnsafeUnpin for StreamSpec
impl UnwindSafe for StreamSpec
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