pub struct MessageKind {
pub version: u8,
pub request_id: u64,
pub id: Option<Uuid>,
pub action: Action,
pub content: Option<Content>,
}Expand description
Use this Message to establish communication between users and Mostro
Fields§
§version: u8Message version
request_id: u64Request id is echoed back to the user
id: Option<Uuid>Message id is not mandatory
action: ActionAction to be taken
content: Option<Content>Message content
Implementations§
Source§impl MessageKind
impl MessageKind
Sourcepub fn new(
request_id: u64,
id: Option<Uuid>,
action: Action,
content: Option<Content>,
) -> Self
pub fn new( request_id: u64, id: Option<Uuid>, action: Action, content: Option<Content>, ) -> 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_content(&self) -> Option<&Content>
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