pub struct MessageKind {
pub version: u8,
pub request_id: Option<u64>,
pub trade_index: Option<i64>,
pub id: Option<Uuid>,
pub action: Action,
pub payload: Option<Payload>,
}Expand description
Use this Message to establish communication between users and Mostro
Fields§
§version: u8Message version
request_id: Option<u64>Request_id for test on client
trade_index: Option<i64>Trade key index
id: Option<Uuid>Message id is not mandatory
action: ActionAction to be taken
payload: Option<Payload>Payload of the Message
Implementations§
Source§impl MessageKind
impl MessageKind
Sourcepub fn new(
id: Option<Uuid>,
request_id: Option<u64>,
trade_index: Option<i64>,
action: Action,
payload: Option<Payload>,
) -> Self
pub fn new( id: Option<Uuid>, request_id: Option<u64>, trade_index: Option<i64>, action: Action, payload: Option<Payload>, ) -> Self
New message
pub fn get_action(&self) -> Action
pub fn get_order(&self) -> Option<&SmallOrder>
pub fn get_payment_request(&self) -> Option<String>
pub fn get_amount(&self) -> Option<i64>
pub fn get_payload(&self) -> Option<&Payload>
pub fn has_trade_index(&self) -> (bool, i64)
pub fn sign(&self, keys: &Keys) -> Signature
pub fn verify_signature(&self, pubkey: PublicKey, sig: Signature) -> bool
Trait Implementations§
Source§impl Debug for MessageKind
impl Debug for MessageKind
Source§impl<'de> Deserialize<'de> for MessageKind
impl<'de> Deserialize<'de> for MessageKind
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MessageKind
impl RefUnwindSafe for MessageKind
impl Send for MessageKind
impl Sync for MessageKind
impl Unpin for MessageKind
impl UnwindSafe for MessageKind
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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