pub enum CuLatchedState<T>where
T: Clone,{
Unset,
Set(T),
}Expand description
Consumer-side cache updated by CuLatchedStateUpdate.
This is typically stored in a task struct and updated as messages arrive. It is not a runtime-managed global store; each consumer keeps its own copy of the latched state so replay and deterministic execution follow the same update sequence as live execution.
Variants§
Unset
No value has been latched yet, or the previous value was cleared.
Set(T)
The most recently latched value.
Implementations§
Source§impl<T> CuLatchedState<T>where
T: Clone,
impl<T> CuLatchedState<T>where
T: Clone,
Sourcepub fn new() -> CuLatchedState<T>
pub fn new() -> CuLatchedState<T>
Creates an empty latched state.
Sourcepub fn as_ref(&self) -> Option<&T>
pub fn as_ref(&self) -> Option<&T>
Returns the currently latched value as a shared reference, if any.
This is equivalent to Self::get.
Sourcepub fn take(&mut self) -> Option<T>
pub fn take(&mut self) -> Option<T>
Removes and returns the currently latched value, leaving the state unset.
Sourcepub fn update_owned(&mut self, update: CuLatchedStateUpdate<T>)
pub fn update_owned(&mut self, update: CuLatchedStateUpdate<T>)
Applies an owned update without cloning the payload value.
Source§impl<T> CuLatchedState<T>where
T: Clone,
impl<T> CuLatchedState<T>where
T: Clone,
Sourcepub fn update(&mut self, update: &CuLatchedStateUpdate<T>)
pub fn update(&mut self, update: &CuLatchedStateUpdate<T>)
Applies a borrowed update, cloning only when the update contains a new value.
Trait Implementations§
Source§impl<'__de, T, __Context> BorrowDecode<'__de, __Context> for CuLatchedState<T>where
T: Clone + BorrowDecode<'__de, __Context>,
impl<'__de, T, __Context> BorrowDecode<'__de, __Context> for CuLatchedState<T>where
T: Clone + BorrowDecode<'__de, __Context>,
Source§fn borrow_decode<__D>(
decoder: &mut __D,
) -> Result<CuLatchedState<T>, DecodeError>where
__D: BorrowDecoder<'__de, Context = __Context>,
fn borrow_decode<__D>(
decoder: &mut __D,
) -> Result<CuLatchedState<T>, DecodeError>where
__D: BorrowDecoder<'__de, Context = __Context>,
Attempt to decode this type with the given BorrowDecode.
Source§impl<T> Clone for CuLatchedState<T>where
T: Clone,
impl<T> Clone for CuLatchedState<T>where
T: Clone,
Source§fn clone(&self) -> CuLatchedState<T>
fn clone(&self) -> CuLatchedState<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> Debug for CuLatchedState<T>
impl<T> Debug for CuLatchedState<T>
Source§impl<T, __Context> Decode<__Context> for CuLatchedState<T>
impl<T, __Context> Decode<__Context> for CuLatchedState<T>
Source§fn decode<__D>(decoder: &mut __D) -> Result<CuLatchedState<T>, DecodeError>where
__D: Decoder<Context = __Context>,
fn decode<__D>(decoder: &mut __D) -> Result<CuLatchedState<T>, DecodeError>where
__D: Decoder<Context = __Context>,
Attempt to decode this type with the given Decode.
Source§impl<T> Default for CuLatchedState<T>where
T: Clone,
impl<T> Default for CuLatchedState<T>where
T: Clone,
Source§fn default() -> CuLatchedState<T>
fn default() -> CuLatchedState<T>
Returns the “default value” for a type. Read more
Source§impl<'de, T> Deserialize<'de> for CuLatchedState<T>where
T: Clone + Deserialize<'de>,
impl<'de, T> Deserialize<'de> for CuLatchedState<T>where
T: Clone + Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CuLatchedState<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CuLatchedState<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> Encode for CuLatchedState<T>
impl<T> Encode for CuLatchedState<T>
Source§impl<T> GetTypeRegistration for CuLatchedState<T>
impl<T> GetTypeRegistration for CuLatchedState<T>
Source§fn get_type_registration() -> TypeRegistration
fn get_type_registration() -> TypeRegistration
Returns the default
TypeRegistration for this type.§fn register_type_dependencies(_registry: &mut TypeRegistry)
fn register_type_dependencies(_registry: &mut TypeRegistry)
Registers other types needed by this type. Read more
Source§impl<T> PartialEq for CuLatchedState<T>
impl<T> PartialEq for CuLatchedState<T>
Source§impl<T> PartialReflect for CuLatchedState<T>
impl<T> PartialReflect for CuLatchedState<T>
Source§fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
Source§fn to_dynamic(&self) -> Box<dyn PartialReflect>
fn to_dynamic(&self) -> Box<dyn PartialReflect>
Source§fn try_apply(
&mut self,
value: &(dyn PartialReflect + 'static),
) -> Result<(), ApplyError>
fn try_apply( &mut self, value: &(dyn PartialReflect + 'static), ) -> Result<(), ApplyError>
Source§fn reflect_kind(&self) -> ReflectKind
fn reflect_kind(&self) -> ReflectKind
Returns a zero-sized enumeration of “kinds” of type. Read more
Source§fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_ref(&self) -> ReflectRef<'_>
Returns an immutable enumeration of “kinds” of type. Read more
Source§fn reflect_mut(&mut self) -> ReflectMut<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
Returns a mutable enumeration of “kinds” of type. Read more
Source§fn reflect_owned(self: Box<CuLatchedState<T>>) -> ReflectOwned
fn reflect_owned(self: Box<CuLatchedState<T>>) -> ReflectOwned
Returns an owned enumeration of “kinds” of type. Read more
Source§fn try_into_reflect(
self: Box<CuLatchedState<T>>,
) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
fn try_into_reflect( self: Box<CuLatchedState<T>>, ) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
Attempts to cast this type to a boxed, fully-reflected value.
Source§fn try_as_reflect(&self) -> Option<&(dyn Reflect + 'static)>
fn try_as_reflect(&self) -> Option<&(dyn Reflect + 'static)>
Attempts to cast this type to a fully-reflected value.
Source§fn try_as_reflect_mut(&mut self) -> Option<&mut (dyn Reflect + 'static)>
fn try_as_reflect_mut(&mut self) -> Option<&mut (dyn Reflect + 'static)>
Attempts to cast this type to a mutable, fully-reflected value.
Source§fn into_partial_reflect(self: Box<CuLatchedState<T>>) -> Box<dyn PartialReflect>
fn into_partial_reflect(self: Box<CuLatchedState<T>>) -> Box<dyn PartialReflect>
Casts this type to a boxed, reflected value. Read more
Source§fn as_partial_reflect(&self) -> &(dyn PartialReflect + 'static)
fn as_partial_reflect(&self) -> &(dyn PartialReflect + 'static)
Casts this type to a reflected value. Read more
Source§fn as_partial_reflect_mut(&mut self) -> &mut (dyn PartialReflect + 'static)
fn as_partial_reflect_mut(&mut self) -> &mut (dyn PartialReflect + 'static)
Casts this type to a mutable, reflected value. Read more
§fn apply(&mut self, value: &(dyn PartialReflect + 'static))
fn apply(&mut self, value: &(dyn PartialReflect + 'static))
Applies a reflected value to this value. Read more
§fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>
fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>
Attempts to clone
Self using reflection. Read more§fn reflect_clone_and_take<T>(&self) -> Result<T, ReflectCloneError>
fn reflect_clone_and_take<T>(&self) -> Result<T, ReflectCloneError>
For a type implementing
PartialReflect, combines reflect_clone and
take in a useful fashion, automatically constructing an appropriate
ReflectCloneError if the downcast fails. Read more§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
Returns a hash of the value (which includes the type). Read more
§fn reflect_partial_eq(
&self,
_value: &(dyn PartialReflect + 'static),
) -> Option<bool>
fn reflect_partial_eq( &self, _value: &(dyn PartialReflect + 'static), ) -> Option<bool>
Returns a “partial equality” comparison result. Read more
§fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Debug formatter for the value. Read more
§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
Indicates whether or not this type is a dynamic type. Read more
Source§impl<T> Reflect for CuLatchedState<T>
impl<T> Reflect for CuLatchedState<T>
Source§fn into_any(self: Box<CuLatchedState<T>>) -> Box<dyn Any>
fn into_any(self: Box<CuLatchedState<T>>) -> Box<dyn Any>
Returns the value as a
Box<dyn Any>. Read moreSource§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Returns the value as a
&mut dyn Any. Read moreSource§fn into_reflect(self: Box<CuLatchedState<T>>) -> Box<dyn Reflect>
fn into_reflect(self: Box<CuLatchedState<T>>) -> Box<dyn Reflect>
Casts this type to a boxed, fully-reflected value.
Source§fn as_reflect(&self) -> &(dyn Reflect + 'static)
fn as_reflect(&self) -> &(dyn Reflect + 'static)
Casts this type to a fully-reflected value.
Source§fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
Casts this type to a mutable, fully-reflected value.
Source§impl<T> Serialize for CuLatchedState<T>
impl<T> Serialize for CuLatchedState<T>
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
Source§impl<T> TypePath for CuLatchedState<T>
impl<T> TypePath for CuLatchedState<T>
Source§fn type_path() -> &'static str
fn type_path() -> &'static str
Returns the fully qualified path of the underlying type. Read more
Source§fn short_type_path() -> &'static str
fn short_type_path() -> &'static str
Returns a short, pretty-print enabled path to the type. Read more
Source§fn type_ident() -> Option<&'static str>
fn type_ident() -> Option<&'static str>
Source§fn crate_name() -> Option<&'static str>
fn crate_name() -> Option<&'static str>
Source§impl<T> Typed for CuLatchedState<T>
impl<T> Typed for CuLatchedState<T>
impl<T> StructuralPartialEq for CuLatchedState<T>where
T: Clone,
Auto Trait Implementations§
impl<T> Freeze for CuLatchedState<T>where
T: Freeze,
impl<T> RefUnwindSafe for CuLatchedState<T>where
T: RefUnwindSafe,
impl<T> Send for CuLatchedState<T>where
T: Send,
impl<T> Sync for CuLatchedState<T>where
T: Sync,
impl<T> Unpin for CuLatchedState<T>where
T: Unpin,
impl<T> UnsafeUnpin for CuLatchedState<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for CuLatchedState<T>where
T: UnwindSafe,
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DynamicTypePath for Twhere
T: TypePath,
impl<T> DynamicTypePath for Twhere
T: TypePath,
§fn reflect_type_path(&self) -> &str
fn reflect_type_path(&self) -> &str
See
TypePath::type_path.§fn reflect_short_type_path(&self) -> &str
fn reflect_short_type_path(&self) -> &str
§fn reflect_type_ident(&self) -> Option<&str>
fn reflect_type_ident(&self) -> Option<&str>
See
TypePath::type_ident.§fn reflect_crate_name(&self) -> Option<&str>
fn reflect_crate_name(&self) -> Option<&str>
See
TypePath::crate_name.§fn reflect_module_path(&self) -> Option<&str>
fn reflect_module_path(&self) -> Option<&str>
§impl<T> DynamicTyped for Twhere
T: Typed,
impl<T> DynamicTyped for Twhere
T: Typed,
§fn reflect_type_info(&self) -> &'static TypeInfo
fn reflect_type_info(&self) -> &'static TypeInfo
See
Typed::type_info.§impl<T> GetPath for T
impl<T> GetPath for T
§fn reflect_path<'p>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>
fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>
Returns a reference to the value specified by
path. Read more§fn reflect_path_mut<'p>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>
fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>
Returns a mutable reference to the value specified by
path. Read more§fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
Returns a statically typed reference to the value specified by
path. Read more§fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
Returns a statically typed mutable reference to the value specified by
path. Read moreSource§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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
§impl<T> TypeData for T
impl<T> TypeData for T
§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
Creates a type-erased clone of this value.