Struct deltachat::message::MsgId

source ·
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

source

pub async fn download_full(self, context: &Context) -> Result<()>

Schedules full message download for partially downloaded message.

source

pub(crate) async fn update_download_state( self, context: &Context, download_state: DownloadState ) -> Result<()>

source§

impl MsgId

source

pub(crate) async fn ephemeral_timer(self, context: &Context) -> Result<Timer>

Returns ephemeral message timer value for the message.

source

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

source

pub fn new(id: u32) -> MsgId

Create a new MsgId.

source

pub fn new_unset() -> MsgId

Create a new unset MsgId.

source

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.

source

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.

source

pub async fn get_state(self, context: &Context) -> Result<MessageState>

Returns message state.

source

pub(crate) async fn get_param(self, context: &Context) -> Result<Params>

source

pub async fn trash(self, context: &Context) -> 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

  1. not download the same message again
  2. be able to delete the message on the server if we want to
source

pub(crate) async fn delete_from_db(self, context: &Context) -> Result<()>

Deletes a message, corresponding MDNs and unsent SMTP messages from the database.

source

pub(crate) async fn set_delivered(self, context: &Context) -> Result<()>

source

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.

source

pub async fn rawtext(self, context: &Context) -> Result<String>

Returns raw text of a message, used for message info

source

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

pub async fn hop_info(self, context: &Context) -> Result<Option<String>>

Returns information about hops of a message, used for message info

source

pub async fn get_info(self, context: &Context) -> Result<String>

Returns detailed message information in a multi-line text form.

source§

impl MsgId

source

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 Clone for MsgId

source§

fn clone(&self) -> MsgId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MsgId

source§

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

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

impl Default for MsgId

source§

fn default() -> MsgId

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

impl<'de> Deserialize<'de> for MsgId

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for MsgId

source§

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

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

impl FromSql for MsgId

Allow converting an SQLite integer directly into MsgId.

source§

fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self>

Converts SQLite value into Rust value.
source§

impl Hash for MsgId

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for MsgId

source§

fn cmp(&self, other: &MsgId) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for MsgId

source§

fn eq(&self, other: &MsgId) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for MsgId

source§

fn partial_cmp(&self, other: &MsgId) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for MsgId

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl ToSql for MsgId

Allow converting MsgId to an SQLite type.

This allows you to directly store MsgId into the database.

§Errors

This does ensure that no special message IDs are written into the database and the conversion will fail if this is not the case.

source§

fn to_sql(&self) -> Result<ToSqlOutput<'_>>

Converts Rust value to SQLite value
source§

impl Copy for MsgId

source§

impl Eq for MsgId

source§

impl StructuralPartialEq for MsgId

Auto Trait Implementations§

§

impl RefUnwindSafe for MsgId

§

impl Send for MsgId

§

impl Sync for MsgId

§

impl Unpin for MsgId

§

impl UnwindSafe for MsgId

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
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32 ) -> TaggedParser<'a, Implicit, Self, E>

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
§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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>,

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
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
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> RpcError for T
where T: Debug + Display + Send + Sync + Unpin + 'static,

§

impl<T> RpcMessage for T
where T: Debug + Serialize + DeserializeOwned + Send + Sync + Unpin + 'static,