#[non_exhaustive]pub struct DataContent {
pub key: String,
pub delayed: Option<bool>,
pub asset_main_type: Option<AssetMainType>,
pub asset_sub_type: Option<AssetSubType>,
pub cusip: Option<String>,
pub fields: HashMap<String, Value>,
}Expand description
One item of a data frame as the streamer sends it: the subscription
key, the service’s envelope keys, and the numbered fields.
Decode into named, typed fields with StreamService::decode or a
payload’s from_content (for example LevelOneEquity::from_content).
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.key: String§delayed: Option<bool>§asset_main_type: Option<AssetMainType>§asset_sub_type: Option<AssetSubType>§cusip: Option<String>§fields: HashMap<String, Value>The numbered fields ("1", "2", …) plus any other key the service
sends, such as seq on chart and account-activity items.
Implementations§
Source§impl DataContent
impl DataContent
Sourcepub fn named_fields(&self, table: &[Field]) -> Map<String, Value>
pub fn named_fields(&self, table: &[Field]) -> Map<String, Value>
The numbered fields renamed per table (see StreamService::fields).
Numbers the table does not list, and non-numeric keys such as seq,
pass through unchanged.
Sourcepub fn to_named_value(&self, table: &[Field]) -> Value
pub fn to_named_value(&self, table: &[Field]) -> Value
The whole item as one JSON object: the envelope (key, delayed,
assetMainType, …) plus named_fields. This is
the shape the typed payloads deserialize from.
Sourcepub fn into_named_value(self, table: &[Field]) -> Value
pub fn into_named_value(self, table: &[Field]) -> Value
to_named_value without copying: for
consumers that own the item and do not need it afterwards.
Trait Implementations§
Source§impl Clone for DataContent
impl Clone for DataContent
Source§impl Debug for DataContent
impl Debug for DataContent
Source§impl<'de> Deserialize<'de> for DataContent
impl<'de> Deserialize<'de> for DataContent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for DataContent
Available on crate feature schemars only.
impl JsonSchema for DataContent
schemars only.Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more