pub struct SmsOutgoingMessage {
pub to: String,
pub content: String,
pub validity_period: Option<u8>,
pub flash: Option<bool>,
pub timeout: Option<u32>,
}Expand description
The outgoing SMS message to be sent to a target number.
Fields§
§to: StringThe target phone number, this should be in international format.
content: StringThe full message content. This will be split into multiple messages by the server if required. This also supports Unicode emojis etc.
validity_period: Option<u8>The relative validity period to use for message sending. This determines how long the message should remain waiting while undelivered. By default, this is determined by the server (24 hours).
flash: Option<bool>Should the SMS message be sent as a Silent class? This makes a popup show on the users device with the message content if they’re logged in.
timeout: Option<u32>A timeout that should be applied to the entire request. If one is not set, the default timeout is used.
Implementations§
Source§impl SmsOutgoingMessage
impl SmsOutgoingMessage
Sourcepub fn simple_message(to: impl Into<String>, content: impl Into<String>) -> Self
pub fn simple_message(to: impl Into<String>, content: impl Into<String>) -> Self
Create a new outgoing message with a default validity period and no flash. The default validity period is applied by SMS-API, so usually 24 hours.
Sourcepub fn with_flash(self, flash: bool) -> Self
pub fn with_flash(self, flash: bool) -> Self
Set the message flash state. This will show a popup if the recipient is logged-in to their phone, otherwise as a normal text message.
Sourcepub fn with_validity_period(self, period: u8) -> Self
pub fn with_validity_period(self, period: u8) -> Self
Set a relative validity period value.
Sourcepub fn with_timeout(self, timeout: u32) -> Self
pub fn with_timeout(self, timeout: u32) -> Self
Set a request timeout value.
Sourcepub fn get_validity_period(&self) -> u8
pub fn get_validity_period(&self) -> u8
Get the message sending validity period, either as set or default. Returns class 0 for a flash message.
Trait Implementations§
Source§impl Clone for SmsOutgoingMessage
impl Clone for SmsOutgoingMessage
Source§fn clone(&self) -> SmsOutgoingMessage
fn clone(&self) -> SmsOutgoingMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SmsOutgoingMessage
impl Debug for SmsOutgoingMessage
Source§impl Default for SmsOutgoingMessage
impl Default for SmsOutgoingMessage
Source§fn default() -> SmsOutgoingMessage
fn default() -> SmsOutgoingMessage
Source§impl From<&SmsOutgoingMessage> for SmsMessage
impl From<&SmsOutgoingMessage> for SmsMessage
Source§fn from(outgoing: &SmsOutgoingMessage) -> Self
fn from(outgoing: &SmsOutgoingMessage) -> Self
Source§impl PartialEq for SmsOutgoingMessage
impl PartialEq for SmsOutgoingMessage
Source§impl Serialize for SmsOutgoingMessage
impl Serialize for SmsOutgoingMessage
impl StructuralPartialEq for SmsOutgoingMessage
Auto Trait Implementations§
impl Freeze for SmsOutgoingMessage
impl RefUnwindSafe for SmsOutgoingMessage
impl Send for SmsOutgoingMessage
impl Sync for SmsOutgoingMessage
impl Unpin for SmsOutgoingMessage
impl UnwindSafe for SmsOutgoingMessage
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
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>
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>
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