Struct crypto_crawler::Message
source · pub struct Message {
pub exchange: String,
pub market_type: MarketType,
pub msg_type: MessageType,
pub symbol: Option<String>,
pub received_at: u64,
pub json: String,
}Expand description
Message represents messages received by crawlers.
Fields
exchange: StringThe exchange name, unique for each exchage
market_type: MarketTypeMarket type
msg_type: MessageTypeMessage type
symbol: Option<String>received_at: u64Unix timestamp in milliseconds
json: Stringthe original message
Implementations
sourceimpl Message
impl Message
pub fn new(
exchange: String,
market_type: MarketType,
msg_type: MessageType,
json: String
) -> Self
pub fn new_with_symbol(
exchange: String,
market_type: MarketType,
msg_type: MessageType,
symbol: String,
json: String
) -> Self
sourcepub fn to_tsv_string(&self) -> String
pub fn to_tsv_string(&self) -> String
Convert to a TSV string.
The exchange, market_type and msg_type fields are not included to save some disk space.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more