pub struct ReducerAction<T> {
pub from: String,
pub time: u64,
pub core: String,
pub payload: T,
}Fields§
§from: StringSender.
time: u64Time when the event occured.
Note: The time from the dispatching device is used.
core: StringCOre affected by this action.
payload: TAction payload.
Implementations§
Source§impl ReducerAction<Ipld>
impl ReducerAction<Ipld>
pub fn set_payload<T>(&mut self, value: &T) -> Result<(), String>where
T: Serialize,
pub fn get_payload<T>(&self) -> Result<T, String>where
T: DeserializeOwned,
Trait Implementations§
Source§impl<T> Clone for ReducerAction<T>where
T: Clone,
impl<T> Clone for ReducerAction<T>where
T: Clone,
Source§fn clone(&self) -> ReducerAction<T>
fn clone(&self) -> ReducerAction<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 ReducerAction<T>where
T: Debug,
impl<T> Debug for ReducerAction<T>where
T: Debug,
Source§impl<'de, T> Deserialize<'de> for ReducerAction<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for ReducerAction<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ReducerAction<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ReducerAction<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> PartialEq for ReducerAction<T>where
T: PartialEq,
impl<T> PartialEq for ReducerAction<T>where
T: PartialEq,
Source§impl<T> Serialize for ReducerAction<T>where
T: Serialize,
impl<T> Serialize for ReducerAction<T>where
T: Serialize,
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
impl<T> StructuralPartialEq for ReducerAction<T>
Auto Trait Implementations§
impl<T> Freeze for ReducerAction<T>where
T: Freeze,
impl<T> RefUnwindSafe for ReducerAction<T>where
T: RefUnwindSafe,
impl<T> Send for ReducerAction<T>where
T: Send,
impl<T> Sync for ReducerAction<T>where
T: Sync,
impl<T> Unpin for ReducerAction<T>where
T: Unpin,
impl<T> UnsafeUnpin for ReducerAction<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ReducerAction<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,
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