pub struct JamMessage { /* private fields */ }Expand description
Used for writing messages to a JAM message base It’s more complex to create a valid jam message than it looks. Using the builder pattern is recommended.
Implementations§
Source§impl JamMessage
impl JamMessage
pub fn msgid_crc(&self) -> u32
Sourcepub fn from_stored(header: JamMessageHeader, text: BString) -> Self
pub fn from_stored(header: JamMessageHeader, text: BString) -> Self
Rebuilds a message from a stored header and its text.
Sourcepub fn new(aka: &EchomailAddress) -> Self
pub fn new(aka: &EchomailAddress) -> Self
Creates a new message with an unique message id
pub fn with_reply_to(self, reply_to: u32) -> Self
Sourcepub fn with_msg_id(self, id: BString) -> Self
pub fn with_msg_id(self, id: BString) -> Self
Keeps the id a message arrived with instead of making up a new one, which is what lets two systems agree that they are looking at the same message.
pub fn with_reply_id(self, id: BString) -> Self
pub fn with_date_time(self, time: DateTime<Utc>) -> Self
pub fn with_packout_date(self, time: DateTime<Utc>) -> Self
pub fn with_text(self, text: BString) -> Self
pub fn with_attributes(self, attributes: u32) -> Self
pub fn with_password(self, password: &BString) -> Self
pub fn with_from(self, name: BString) -> Self
pub fn with_to(self, name: BString) -> Self
pub fn with_subject(self, subject: BString) -> Self
pub fn with_sub_field(self, sub_field: MessageSubfield) -> Self
pub fn with_is_deleted(self, deleted: bool) -> Self
pub fn text(&self) -> &BString
pub fn header(&self) -> &JamMessageHeader
pub fn reply_to(&self) -> u32
pub fn reply_first(&self) -> u32
pub fn reply_next(&self) -> u32
pub fn from(&self) -> Option<&BString>
pub fn to(&self) -> Option<&BString>
pub fn set_reply_crc(&mut self, crc: u32)
pub fn set_reply_first(&mut self, reply_first: u32)
pub fn set_reply_next(&mut self, reply_next: u32)
Trait Implementations§
Source§impl Default for JamMessage
impl Default for JamMessage
Source§fn default() -> JamMessage
fn default() -> JamMessage
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for JamMessage
impl RefUnwindSafe for JamMessage
impl Send for JamMessage
impl Sync for JamMessage
impl Unpin for JamMessage
impl UnsafeUnpin for JamMessage
impl UnwindSafe for JamMessage
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> 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