pub enum Publish {
Initial {
body: String,
expires: Duration,
},
Refresh {
tag: String,
expires: Duration,
},
Modify {
tag: String,
body: String,
expires: Duration,
},
Remove {
tag: String,
},
Empty,
}Expand description
What a PUBLISH asked for (RFC 3903 §4.1, §6).
The three operations differ only by what is present, which is why they are read as one thing
and dispatched on: an entity tag with no body is a refresh, with a body a modify, and with
Expires: 0 a removal.
Variants§
Initial
First publication: a body and no entity tag.
Refresh
A refresh: an entity tag and no body.
Modify
A modification: an entity tag and a body.
Fields
Remove
A removal: an entity tag and Expires: 0.
Empty
Neither a body nor a tag — §6 step 5 says reject this.
It is not an empty publication: there is nothing to publish and nothing to identify, so there is no operation it could be.
Implementations§
Trait Implementations§
impl StructuralPartialEq for Publish
Auto Trait Implementations§
impl Freeze for Publish
impl RefUnwindSafe for Publish
impl Send for Publish
impl Sync for Publish
impl Unpin for Publish
impl UnsafeUnpin for Publish
impl UnwindSafe for Publish
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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