#[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
Source§type EndpointError = Error
type EndpointError = Error
Source§type IncomingResponse = Response
type IncomingResponse = Response
Source§fn try_into_http_request<T: Default + BufMut>(
self,
base_url: &str,
access_token: SendAccessToken<'_>,
considering_versions: &[MatrixVersion],
) -> Result<Request<T>, IntoHttpError>
fn try_into_http_request<T: Default + BufMut>( 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§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> 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.