#[non_exhaustive]pub struct FeedCapabilities {
pub timeframes: Option<Vec<Timeframe>>,
pub exchanges: Option<Vec<String>>,
pub symbol_types: Option<Vec<SymbolType>>,
pub services: Option<Vec<FeedService>>,
}Expand description
What a feed offers as a whole, answered by Datafeed::capabilities. Each list distinguishes
None, which the feed does not report and so restricts nothing, from Some of an empty
list, which it reports as offering none. Use declares when a service
needs explicit confirmation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.timeframes: Option<Vec<Timeframe>>Intervals Datafeed::history answers for at least some symbol. A symbol’s own
supported_timeframes narrows them further.
exchanges: Option<Vec<String>>Exchanges whose symbols the feed serves.
symbol_types: Option<Vec<SymbolType>>Classes of symbol the feed serves.
services: Option<Vec<FeedService>>Optional services the feed supplies for at least some symbol. A symbol’s own
services narrows them further. Services absent from a
reported list are unavailable.
Implementations§
Source§impl FeedCapabilities
impl FeedCapabilities
Sourcepub fn with_timeframes(
self,
timeframes: impl IntoIterator<Item = Timeframe>,
) -> Self
pub fn with_timeframes( self, timeframes: impl IntoIterator<Item = Timeframe>, ) -> Self
Sets timeframes.
Sourcepub fn with_exchanges(self, exchanges: impl IntoIterator<Item = String>) -> Self
pub fn with_exchanges(self, exchanges: impl IntoIterator<Item = String>) -> Self
Sets exchanges.
Sourcepub fn with_symbol_types(
self,
types: impl IntoIterator<Item = SymbolType>,
) -> Self
pub fn with_symbol_types( self, types: impl IntoIterator<Item = SymbolType>, ) -> Self
Sets symbol_types.
Sourcepub fn with_services(
self,
services: impl IntoIterator<Item = FeedService>,
) -> Self
pub fn with_services( self, services: impl IntoIterator<Item = FeedService>, ) -> Self
Sets services.
Sourcepub fn offers(&self, service: FeedService) -> bool
pub fn offers(&self, service: FeedService) -> bool
Whether to offer the controls of service: it is listed, or the feed reports no list.
Sourcepub fn declares(&self, service: FeedService, instrument: &Instrument) -> bool
pub fn declares(&self, service: FeedService, instrument: &Instrument) -> bool
Whether service is explicitly reported for instrument. Its own list takes precedence;
without one, the feed’s list applies. A reported feed list must also include the service.
With neither list reported, this returns false, unlike offers.
Trait Implementations§
Source§impl Clone for FeedCapabilities
impl Clone for FeedCapabilities
Source§fn clone(&self) -> FeedCapabilities
fn clone(&self) -> FeedCapabilities
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FeedCapabilities
impl Debug for FeedCapabilities
Source§impl Default for FeedCapabilities
impl Default for FeedCapabilities
Source§fn default() -> FeedCapabilities
fn default() -> FeedCapabilities
Source§impl PartialEq for FeedCapabilities
impl PartialEq for FeedCapabilities
impl StructuralPartialEq for FeedCapabilities
Auto Trait Implementations§
impl Freeze for FeedCapabilities
impl RefUnwindSafe for FeedCapabilities
impl Send for FeedCapabilities
impl Sync for FeedCapabilities
impl Unpin for FeedCapabilities
impl UnsafeUnpin for FeedCapabilities
impl UnwindSafe for FeedCapabilities
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more