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 PartialOrd for MsgId
impl PartialOrd for MsgId
source§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: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
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<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.