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>) -> Self
pub fn snapshot(version: Version, body: impl Into<Bytes>) -> Self
Create a snapshot update with complete state.
Sourcepub fn patched(version: Version, patches: Vec<Patch>) -> Self
pub fn patched(version: Version, patches: Vec<Patch>) -> Self
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>) -> Self
pub fn subscription_patched(version: Version, patches: Vec<Patch>) -> Self
pub fn with_parent(self, parent: Version) -> Self
pub fn with_parents(self, parents: Vec<Version>) -> Self
pub fn with_current_version(self, version: Version) -> Self
pub fn with_merge_type(self, merge_type: impl Into<String>) -> Self
pub fn with_content_range(self, content_range: ContentRange) -> Self
pub fn with_content_type(self, content_type: impl Into<String>) -> Self
pub fn with_status(self, status: u16) -> Self
pub fn with_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. 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