pub struct MsgId(u32);
Expand description
Message ID, including reserved IDs.
Some message IDs are reserved to identify special message types. This type can represent both the special as well as normal messages.
Tuple Fields§
§0: u32
Implementations§
source§impl MsgId
impl MsgId
sourcepub async fn download_full(self, context: &Context) -> Result<()>
pub async fn download_full(self, context: &Context) -> Result<()>
Schedules full message download for partially downloaded message.
sourcepub(crate) async fn update_download_state(
self,
context: &Context,
download_state: DownloadState,
) -> Result<()>
pub(crate) async fn update_download_state( self, context: &Context, download_state: DownloadState, ) -> Result<()>
Updates the message download state. Returns Ok
if the message doesn’t exist anymore.
source§impl MsgId
impl MsgId
sourcepub(crate) async fn ephemeral_timer(self, context: &Context) -> Result<Timer>
pub(crate) async fn ephemeral_timer(self, context: &Context) -> Result<Timer>
Returns ephemeral message timer value for the message.
sourcepub(crate) async fn start_ephemeral_timer(self, context: &Context) -> Result<()>
pub(crate) async fn start_ephemeral_timer(self, context: &Context) -> Result<()>
Starts ephemeral message timer for the message if it is not started yet.
source§impl MsgId
impl MsgId
sourcepub fn is_special(self) -> bool
pub fn is_special(self) -> bool
Whether the message ID signifies a special message.
This kind of message ID can not be used for real messages.
sourcepub fn is_unset(self) -> bool
pub fn is_unset(self) -> bool
Whether the message ID is unset.
When a message is created it initially has a ID of 0
, which
is filled in by a real message ID once the message is saved in
the database. This returns true while the message has not
been saved and thus not yet been given an actual message ID.
When this is true
, MsgId::is_special will also always be
true
.
sourcepub async fn get_state(self, context: &Context) -> Result<MessageState>
pub async fn get_state(self, context: &Context) -> Result<MessageState>
Returns message state.
pub(crate) async fn get_param(self, context: &Context) -> Result<Params>
sourcepub async fn trash(self, context: &Context, on_server: bool) -> Result<()>
pub async fn trash(self, context: &Context, on_server: bool) -> Result<()>
Put message into trash chat and delete message text.
It means the message is deleted locally, but not on the server. We keep some infos to
- not download the same message again
- be able to delete the message on the server if we want to
on_server
: Delete the message on the server also if it is seen on IMAP later, but only if all parts of the message are trashed with this flag.true
if the user explicitly deletes the message. As for trashing a partially downloaded message when replacing it with a fully downloaded one, seereceive_imf::add_parts()
.
pub(crate) async fn set_delivered(self, context: &Context) -> Result<()>
sourcepub fn to_u32(self) -> u32
pub fn to_u32(self) -> u32
Bad evil escape hatch.
Avoid using this, eventually types should be cleaned up enough that it is no longer necessary.
sourcepub async fn rawtext(self, context: &Context) -> Result<String>
pub async fn rawtext(self, context: &Context) -> Result<String>
Returns raw text of a message, used for message info
sourcepub async fn get_info_server_urls(
context: &Context,
rfc724_mid: String,
) -> Result<Vec<String>>
pub async fn get_info_server_urls( context: &Context, rfc724_mid: String, ) -> Result<Vec<String>>
Returns server foldernames and UIDs of a message, used for message info
source§impl MsgId
impl MsgId
sourcepub async fn get_html(self, context: &Context) -> Result<Option<String>>
pub async fn get_html(self, context: &Context) -> Result<Option<String>>
Get HTML by database message id.
This requires mime_headers
field to be set for the message;
this is the case at least when Message.has_html()
returns true
(we do not save raw mime unconditionally in the database to save space).
The corresponding ffi-function is dc_get_msg_html()
.
Trait Implementations§
source§impl<'de> Deserialize<'de> for MsgId
impl<'de> Deserialize<'de> for MsgId
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>,
source§impl FromSql for MsgId
impl FromSql for MsgId
Allow converting an SQLite integer directly into MsgId.
source§fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self>
fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self>
source§impl Ord for MsgId
impl Ord for MsgId
source§impl PartialEq for MsgId
impl PartialEq for MsgId
source§impl PartialOrd for MsgId
impl PartialOrd for MsgId
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl ToSql for MsgId
impl ToSql for MsgId
impl Copy for MsgId
impl Eq for MsgId
impl StructuralPartialEq for MsgId
Auto Trait Implementations§
impl Freeze for MsgId
impl RefUnwindSafe for MsgId
impl Send for MsgId
impl Sync for MsgId
impl Unpin for MsgId
impl UnwindSafe for MsgId
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Conv for T
impl<T> Conv for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.