pub enum PreviousDescription<'a> {
Resolve,
Absent,
Id(&'a str),
}Expand description
The description a Groups::set_description call expects to replace.
The server takes the prev attribute as an optimistic-concurrency token: it
applies the update only when the token matches the group’s current
description id, and answers 409 conflict otherwise. A group with no
description expects no token at all.
The default is PreviousDescription::Resolve because it is the only
variant that is correct without knowing anything about the group. Note that
it is also the only one that costs a round trip.
Variants§
Resolve
Read the group’s current description id from the server before sending. The right choice when the caller holds no fresh metadata.
Absent
The group carries no description yet (a freshly created group), so no token is sent.
Id(&'a str)
A description id the caller already holds, typically
GroupMetadata::description_id from a recent Groups::get_metadata.
Trait Implementations§
Source§impl<'a> Clone for PreviousDescription<'a>
impl<'a> Clone for PreviousDescription<'a>
Source§fn clone(&self) -> PreviousDescription<'a>
fn clone(&self) -> PreviousDescription<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for PreviousDescription<'a>
Source§impl<'a> Debug for PreviousDescription<'a>
impl<'a> Debug for PreviousDescription<'a>
Source§impl<'a> Default for PreviousDescription<'a>
impl<'a> Default for PreviousDescription<'a>
Source§fn default() -> PreviousDescription<'a>
fn default() -> PreviousDescription<'a>
impl<'a> Eq for PreviousDescription<'a>
Source§impl<'a> From<Option<&'a str>> for PreviousDescription<'a>
Turns a held GroupMetadata::description_id into a token.
impl<'a> From<Option<&'a str>> for PreviousDescription<'a>
Turns a held GroupMetadata::description_id into a token.
None means “that metadata says the group has no description”, so it maps
to PreviousDescription::Absent and not to a fresh read. Metadata stale
enough to have missed a description added since is therefore answered with
GroupError::DescriptionConflict; pass PreviousDescription::Resolve
when the age of the metadata is unknown.
Source§impl<'a> PartialEq for PreviousDescription<'a>
impl<'a> PartialEq for PreviousDescription<'a>
impl<'a> StructuralPartialEq for PreviousDescription<'a>
Auto Trait Implementations§
impl<'a> Freeze for PreviousDescription<'a>
impl<'a> RefUnwindSafe for PreviousDescription<'a>
impl<'a> Send for PreviousDescription<'a>
impl<'a> Sync for PreviousDescription<'a>
impl<'a> Unpin for PreviousDescription<'a>
impl<'a> UnsafeUnpin for PreviousDescription<'a>
impl<'a> UnwindSafe for PreviousDescription<'a>
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read more