pub struct CachedParam<T> { /* private fields */ }Expand description
Cache for a single parameter value.
Implementations§
Source§impl<T: PartialEq + Clone> CachedParam<T>
impl<T: PartialEq + Clone> CachedParam<T>
pub fn new(value: T) -> Self
pub fn set(&mut self, value: T)
Sourcepub fn update<TD: TypeDesc<Repr = T>>(
&mut self,
value: T,
td: &TD,
) -> Result<(Value, f64, bool), Error>
pub fn update<TD: TypeDesc<Repr = T>>( &mut self, value: T, td: &TD, ) -> Result<(Value, f64, bool), Error>
Gets a newly determined value for this parameter, which is then cached, possibly an update message is sent, and the value is returned JSONified for sending in a reply.
pub fn time(&self) -> f64
Trait Implementations§
Source§impl<T> Debug for CachedParam<T>where
T: Debug,
impl<T> Debug for CachedParam<T>where
T: Debug,
Source§impl<T: Default> Default for CachedParam<T>
impl<T: Default> Default for CachedParam<T>
Source§fn default() -> CachedParam<T>
fn default() -> CachedParam<T>
Returns the “default value” for a type. Read more
Source§impl<T> Display for CachedParam<T>where
T: Display,
impl<T> Display for CachedParam<T>where
T: Display,
Auto Trait Implementations§
impl<T> Freeze for CachedParam<T>where
T: Freeze,
impl<T> RefUnwindSafe for CachedParam<T>where
T: RefUnwindSafe,
impl<T> Send for CachedParam<T>where
T: Send,
impl<T> Sync for CachedParam<T>where
T: Sync,
impl<T> Unpin for CachedParam<T>where
T: Unpin,
impl<T> UnwindSafe for CachedParam<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, A> DynAccess<T> for A
impl<T, A> DynAccess<T> for A
Source§fn load(&self) -> DynGuard<T>
fn load(&self) -> DynGuard<T>
The equivalent of
Access::load.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