pub struct SmsMessage {
pub message_id: Option<i64>,
pub phone_number: String,
pub message_content: String,
pub message_reference: Option<u8>,
pub is_outgoing: bool,
pub created_at: Option<u32>,
pub completed_at: Option<u32>,
pub status: Option<u8>,
}Expand description
Represents a stored SMS message from the database.
Fields§
§message_id: Option<i64>Unique identifier for the message.
phone_number: StringThe phone number associated with this message.
message_content: StringThe actual text content of the message.
message_reference: Option<u8>Optional reference number for message tracking. This is assigned by the modem and is only present for outgoing messages.
is_outgoing: boolWhether this message was sent (true) or received (false).
created_at: Option<u32>Unix timestamp when the message was created.
completed_at: Option<u32>Optional Unix timestamp when the message was completed/delivered.
status: Option<u8>Service message center delivery status.
Implementations§
Source§impl SmsMessage
impl SmsMessage
Sourcepub fn with_message_id(&self, id: Option<i64>) -> Self
pub fn with_message_id(&self, id: Option<i64>) -> Self
Returns a clone of the message with the message_id option replaced.
Sourcepub fn created_at(&self) -> Option<SystemTime>
pub fn created_at(&self) -> Option<SystemTime>
Get the message created_at time as SystemTime.
Trait Implementations§
Source§impl Clone for SmsMessage
impl Clone for SmsMessage
Source§fn clone(&self) -> SmsMessage
fn clone(&self) -> SmsMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ComposeSchema for SmsMessage
impl ComposeSchema for SmsMessage
Source§impl Debug for SmsMessage
impl Debug for SmsMessage
Source§impl<'de> Deserialize<'de> for SmsMessage
impl<'de> Deserialize<'de> for SmsMessage
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
Source§impl From<&SmsIncomingMessage> for SmsMessage
impl From<&SmsIncomingMessage> for SmsMessage
Source§fn from(incoming: &SmsIncomingMessage) -> Self
fn from(incoming: &SmsIncomingMessage) -> Self
Converts to this type from the input type.
Source§impl From<&SmsOutgoingMessage> for SmsMessage
impl From<&SmsOutgoingMessage> for SmsMessage
Source§fn from(outgoing: &SmsOutgoingMessage) -> Self
fn from(outgoing: &SmsOutgoingMessage) -> Self
Converts to this type from the input type.
Source§impl From<(SmsOutgoingMessage, HttpSmsSendResponse)> for SmsMessage
Combine an outgoing message and send response into a dummy SmsStoredMessage.
impl From<(SmsOutgoingMessage, HttpSmsSendResponse)> for SmsMessage
Combine an outgoing message and send response into a dummy SmsStoredMessage.
Source§fn from(value: (SmsOutgoingMessage, HttpSmsSendResponse)) -> SmsMessage
fn from(value: (SmsOutgoingMessage, HttpSmsSendResponse)) -> SmsMessage
Converts to this type from the input type.
Source§impl PartialEq for SmsMessage
impl PartialEq for SmsMessage
Source§impl Serialize for SmsMessage
impl Serialize for SmsMessage
Source§impl ToSchema for SmsMessage
impl ToSchema for SmsMessage
impl StructuralPartialEq for SmsMessage
Auto Trait Implementations§
impl Freeze for SmsMessage
impl RefUnwindSafe for SmsMessage
impl Send for SmsMessage
impl Sync for SmsMessage
impl Unpin for SmsMessage
impl UnwindSafe for SmsMessage
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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