pub struct Update {
pub version: Vec<Version>,
pub parents: Vec<Version>,
pub current_version: Option<Vec<Version>>,
pub merge_type: Option<String>,
pub patches: Option<Vec<Patch>>,
pub body: Option<Bytes>,
pub content_range: Option<ContentRange>,
pub content_type: Option<String>,
pub status: u16,
pub extra_headers: BTreeMap<String, String>,
pub url: Option<String>,
}Fields§
§version: Vec<Version>Version ID(s)
parents: Vec<Version>Parent version(s)
current_version: Option<Vec<Version>>Catch-up signaling
merge_type: Option<String>Conflict resolution strategy
patches: Option<Vec<Patch>>Incremental updates
body: Option<Bytes>Complete state content
content_range: Option<ContentRange>Content range for single patch
content_type: Option<String>Media type
status: u16HTTP status code
extra_headers: BTreeMap<String, String>Additional headers
url: Option<String>Target URL
Implementations§
Source§impl Update
impl Update
Sourcepub fn snapshot(version: Version, body: impl Into<Bytes>) -> Update
pub fn snapshot(version: Version, body: impl Into<Bytes>) -> Update
Create a snapshot update with complete state.
Sourcepub fn patched(version: Version, patches: Vec<Patch>) -> Update
pub fn patched(version: Version, patches: Vec<Patch>) -> Update
Create a patch update with incremental changes.
pub fn is_snapshot(&self) -> bool
pub fn is_patched(&self) -> bool
pub fn primary_version(&self) -> Option<&Version>
pub fn body_str(&self) -> Option<&str>
pub fn subscription_snapshot(version: Version, body: impl Into<Bytes>) -> Update
pub fn subscription_patched(version: Version, patches: Vec<Patch>) -> Update
pub fn with_parent(self, parent: Version) -> Update
pub fn with_parents(self, parents: Vec<Version>) -> Update
pub fn with_current_version(self, version: Version) -> Update
pub fn with_merge_type(self, merge_type: impl Into<String>) -> Update
pub fn with_content_range(self, content_range: ContentRange) -> Update
pub fn with_content_type(self, content_type: impl Into<String>) -> Update
pub fn with_status(self, status: u16) -> Update
pub fn with_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Update
pub fn to_json(&self) -> Value
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Update
impl<'de> Deserialize<'de> for Update
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Update, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Update, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl IntoResponse for Update
Available on crate feature server only.
impl IntoResponse for Update
Available on crate feature
server only.Source§fn into_response(self) -> Response<Body>
fn into_response(self) -> Response<Body>
Create a response.
Source§impl Serialize for Update
impl Serialize for Update
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl !Freeze for Update
impl RefUnwindSafe for Update
impl Send for Update
impl Sync for Update
impl Unpin for Update
impl UnwindSafe for Update
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, S> Handler<IntoResponseHandler, S> for T
impl<T, S> Handler<IntoResponseHandler, S> for T
Source§fn call(
self,
_req: Request<Body>,
_state: S,
) -> <T as Handler<IntoResponseHandler, S>>::Future
fn call( self, _req: Request<Body>, _state: S, ) -> <T as Handler<IntoResponseHandler, S>>::Future
Call the handler with the given request.
Source§fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>where
L: Layer<HandlerService<Self, T, S>> + Clone,
<L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,
fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>where
L: Layer<HandlerService<Self, T, S>> + Clone,
<L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,
Apply a
tower::Layer to the handler. Read moreSource§fn with_state(self, state: S) -> HandlerService<Self, T, S>
fn with_state(self, state: S) -> HandlerService<Self, T, S>
Convert the handler into a
Service by providing the stateSource§impl<H, T> HandlerWithoutStateExt<T> for H
impl<H, T> HandlerWithoutStateExt<T> for H
Source§fn into_service(self) -> HandlerService<H, T, ()>
fn into_service(self) -> HandlerService<H, T, ()>
Convert the handler into a
Service and no state.Source§fn into_make_service(self) -> IntoMakeService<HandlerService<H, T, ()>>
fn into_make_service(self) -> IntoMakeService<HandlerService<H, T, ()>>
Convert the handler into a
MakeService and no state. Read moreSource§fn into_make_service_with_connect_info<C>(
self,
) -> IntoMakeServiceWithConnectInfo<HandlerService<H, T, ()>, C>
fn into_make_service_with_connect_info<C>( self, ) -> IntoMakeServiceWithConnectInfo<HandlerService<H, T, ()>, C>
Convert the handler into a
MakeService which stores information
about the incoming connection and has no state. Read more