pub struct MessageFlags(/* private fields */);Expand description
Bitflags for message state (1 byte instead of 4+ bytes for separate bools)
Layout (bits): 0=mine, 1=pending, 2=failed, 3-4=replied_to_has_attachment replied_to_has_attachment: 00=None, 01=Some(false), 10=Some(true)
Note: No EDITED flag - check edit_history.is_some() instead
Implementations§
Source§impl MessageFlags
impl MessageFlags
pub const NONE: Self
pub const MINE: Self
pub const PENDING: Self
pub const FAILED: Self
pub fn is_mine(self) -> bool
pub fn is_pending(self) -> bool
pub fn is_failed(self) -> bool
Sourcepub fn replied_to_has_attachment(self) -> Option<bool>
pub fn replied_to_has_attachment(self) -> Option<bool>
Get replied_to_has_attachment as Option
pub fn set_mine(&mut self, value: bool)
pub fn set_pending(&mut self, value: bool)
pub fn set_failed(&mut self, value: bool)
Sourcepub fn set_replied_to_has_attachment(&mut self, value: Option<bool>)
pub fn set_replied_to_has_attachment(&mut self, value: Option<bool>)
Set replied_to_has_attachment from Option
Sourcepub fn from_bools(mine: bool, pending: bool, failed: bool) -> Self
pub fn from_bools(mine: bool, pending: bool, failed: bool) -> Self
Create flags from individual booleans
Trait Implementations§
Source§impl Clone for MessageFlags
impl Clone for MessageFlags
Source§fn clone(&self) -> MessageFlags
fn clone(&self) -> MessageFlags
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MessageFlags
Source§impl Debug for MessageFlags
impl Debug for MessageFlags
Source§impl Default for MessageFlags
impl Default for MessageFlags
Source§fn default() -> MessageFlags
fn default() -> MessageFlags
Returns the “default value” for a type. Read more
impl Eq for MessageFlags
Source§impl PartialEq for MessageFlags
impl PartialEq for MessageFlags
impl StructuralPartialEq for MessageFlags
Auto Trait Implementations§
impl Freeze for MessageFlags
impl RefUnwindSafe for MessageFlags
impl Send for MessageFlags
impl Sync for MessageFlags
impl Unpin for MessageFlags
impl UnsafeUnpin for MessageFlags
impl UnwindSafe for MessageFlags
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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