MessageBuilder

Struct MessageBuilder 

Source
pub struct MessageBuilder { /* private fields */ }
Expand description

A builder to construct the properties of a Message.

Implementations§

Source§

impl MessageBuilder

Source

pub fn build(self) -> Message

Returns a Message that uses this MessageBuilder configuration.

Source

pub fn da(self, da: impl Into<String>) -> Self

Sets the da, or Destination Address, for the Message.

This is the number to which the message is to be sent and should be a full international format number (however, national format is also accepted). This may be a SIP2SIM ICCID to send direct to a SIM.

This is the same as MessageBuilder::destination()

Source

pub fn destination(self, destination: impl Into<String>) -> Self

Sets the da, or Destination Address, for the Message.

This is the same as MessageBuilder::da()

Source

pub fn ud(self, ud: impl Into<String>) -> Self

Sets the ud, or User Data ie. the text body, for the Message.

This is the message to send, encoded in UTF-8.

This is the same as MessageBuilder::message()

Source

pub fn message(self, message: impl Into<String>) -> Self

Sets the ud, or User Data ie. the text body, for the Message.

This is the same as MessageBuilder::ud()

Source

pub fn limit(self, limit: u8) -> Self

Sets the limit for the Message.

This is the limit on the number of parts that the message may be sent in.

Source

pub fn costcentre(self, costcentre: impl Into<String>) -> Self

Sets the costcentre for the Message.

This is the optional, up to 10 characters, code that is included in the bill XML data.

Source

pub fn private(self, private: bool) -> Self

Sets the private setting for the Message.

This marks the message as private, such that it is not included in the itemised billing.

Source

pub fn oa(self, oa: impl Into<String>) -> Self

Sets the oa, or originator, for the Message.

This is used to set where the message is from. Normally this is not needed as it will default to your username phone number.

Source

pub fn udh(self, udh: impl Into<String>) -> Self

Sets the udh, or User Data Header, for the Message.

This is a hex-coded GSM 03.40 UDH.

Source

pub fn srr(self, srr: impl Into<String>) -> Self

Sets the srr, or SMS Status Report, for the Message.

This is the URL or email address to send delivery reports.

Trait Implementations§

Source§

impl Debug for MessageBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MessageBuilder

Source§

fn default() -> MessageBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more