pub struct Response {
pub initial: bool,
pub txn_id: Option<String>,
pub pos: String,
pub lists: BTreeMap<String, SyncList>,
pub rooms: BTreeMap<OwnedRoomId, SlidingSyncRoom>,
pub extensions: Extensions,
pub delta_token: Option<String>,
}
client-api-c
or client-api-s
) and (crate features client
or server
) and crate feature api
and crate feature unstable-msc3575
only.Expand description
Response type for the sync
endpoint.
Fields§
§initial: bool
Whether this response describes an initial sync (i.e. after the pos
token has been
discard by the server?).
txn_id: Option<String>
Matches the txn_id
sent by the request. Please see Request::txn_id
.
pos: String
The token to supply in the pos
param of the next /sync
request.
lists: BTreeMap<String, SyncList>
Updates on the order of rooms, mapped by the names we asked for.
rooms: BTreeMap<OwnedRoomId, SlidingSyncRoom>
The updates on rooms.
extensions: Extensions
Extensions API.
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.
Implementations§
Trait Implementations§
source§impl IncomingResponse for Response
Available on crate feature client
only.
impl IncomingResponse for Response
client
only.source§type EndpointError = Error
type EndpointError = Error
source§fn try_from_http_response<T>(
response: Response<T>,
) -> Result<Response, FromHttpResponseError<Error>>
fn try_from_http_response<T>( response: Response<T>, ) -> Result<Response, FromHttpResponseError<Error>>
http::Response
into this response type.source§impl OutgoingResponse for Response
Available on crate feature server
only.
impl OutgoingResponse for Response
server
only.source§fn try_into_http_response<T>(self) -> Result<Response<T>, IntoHttpError>
fn try_into_http_response<T>(self) -> Result<Response<T>, IntoHttpError>
http::Response
. Read moreAuto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnwindSafe for Response
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
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 more