#[non_exhaustive]
pub struct MessagesOptions<'a> { pub from: Option<&'a str>, pub to: Option<&'a str>, pub dir: Direction, pub limit: UInt, pub filter: RoomEventFilter<'a>, }
Expand description

Fields (Non-exhaustive)

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
from: Option<&'a str>

The token to start returning events from.

This token can be obtained from a prev_batch token returned for each room from the sync API, or from a start or end token returned by a previous messages call.

If from isn’t provided the homeserver shall return a list of messages from the first or last (per the value of the dir parameter) visible event in the room history for the requesting user.

to: Option<&'a str>

The token to stop returning events at.

This token can be obtained from a prev_batch token returned for each room by the sync API, or from a start or end token returned by a previous messages call.

dir: Direction

The direction to return events in.

limit: UInt

The maximum number of events to return.

Default: 10.

filter: RoomEventFilter<'a>

A [RoomEventFilter] to filter returned events with.

Implementations

Creates MessagesOptions with the given direction.

All other parameters will be defaulted.

Creates MessagesOptions with dir set to Backward.

If no from token is set afterwards, pagination will start at the end of (the accessible part of) the room timeline.

Creates MessagesOptions with dir set to Forward.

If no from token is set afterwards, pagination will start at the beginning of (the accessible part of) the room timeline.

Creates a new MessagesOptions from self with the from field set to the given value.

Since the field is public, you can also assign to it directly. This method merely acts as a shorthand for that, because it is very common to set this field.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more