Struct matrix_sdk_base::sliding_sync::http::msc3575::Request
source · #[non_exhaustive]pub struct Request {
pub pos: Option<String>,
pub delta_token: Option<String>,
pub conn_id: Option<String>,
pub txn_id: Option<String>,
pub timeout: Option<Duration>,
pub lists: BTreeMap<String, SyncRequestList>,
pub room_subscriptions: BTreeMap<OwnedRoomId, RoomSubscription>,
pub unsubscribe_rooms: Vec<OwnedRoomId>,
pub extensions: ExtensionsConfig,
}
Expand description
Request type for the sync
endpoint.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.pos: Option<String>
A point in time to continue a sync from.
Should be a token from the pos
field of a previous /sync
response.
delta_token: Option<String>
The delta token to store for session recovery.
The delta token is a future bandwidth optimisation to resume from an earlier session. If you received a delta token in your last response you can persist and it when establishing a new sessions to “resume” from the last state and not resend information you had stored. If you send a delta token, the server expects you to have stored the last state, if there is no delta token present the server will resend all information necessary to calculate the state.
Please consult “Bandwidth optimisations for persistent clients” of the MSC for further details, expectations of the implementation and limitations to consider before implementing this.
conn_id: Option<String>
A unique string identifier for this connection to the server.
Optional. If this is missing, only one sliding sync connection can be made to the server at any one time. Clients need to set this to allow more than one connection concurrently, so the server can distinguish between connections. This is NOT STICKY and must be provided with every request, if your client needs more than one concurrent connection.
Limitation: it must not contain more than 16 chars, due to it being required with every request.
txn_id: Option<String>
Allows clients to know what request params reached the server, functionally similar to txn IDs on /send for events.
timeout: Option<Duration>
The maximum time to poll before responding to this request.
lists: BTreeMap<String, SyncRequestList>
The list configurations of rooms we are interested in mapped by name.
room_subscriptions: BTreeMap<OwnedRoomId, RoomSubscription>
Specific rooms and event types that we want to receive events from.
unsubscribe_rooms: Vec<OwnedRoomId>
Specific rooms we no longer want to receive events from.
extensions: ExtensionsConfig
Extensions API.
Implementations§
Trait Implementations§
source§impl OutgoingRequest for Request
impl OutgoingRequest for Request
§type EndpointError = Error
type EndpointError = Error
§type IncomingResponse = Response
type IncomingResponse = Response
source§fn try_into_http_request<T>(
self,
base_url: &str,
access_token: SendAccessToken<'_>,
considering_versions: &[MatrixVersion],
) -> Result<Request<T>, IntoHttpError>
fn try_into_http_request<T>( self, base_url: &str, access_token: SendAccessToken<'_>, considering_versions: &[MatrixVersion], ) -> Result<Request<T>, IntoHttpError>
http::Request
. Read moreAuto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
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
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
)source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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>
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>
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 moresource§impl<T> OutgoingRequestAppserviceExt for Twhere
T: OutgoingRequest,
impl<T> OutgoingRequestAppserviceExt for Twhere
T: OutgoingRequest,
source§fn try_into_http_request_with_user_id<T>(
self,
base_url: &str,
access_token: SendAccessToken<'_>,
user_id: &UserId,
considering_versions: &[MatrixVersion],
) -> Result<Request<T>, IntoHttpError>
fn try_into_http_request_with_user_id<T>( self, base_url: &str, access_token: SendAccessToken<'_>, user_id: &UserId, considering_versions: &[MatrixVersion], ) -> Result<Request<T>, IntoHttpError>
http::Request
and appends a virtual user_id
to
assert Appservice identity.