pub struct ActionRecord {
pub history: Vec<RawContext>,
}
Expand description
The specific record.
Fields§
§history: Vec<RawContext>
The history actions.
Implementations§
source§impl ActionRecord
impl ActionRecord
sourcepub fn last_ctx(&self) -> Option<&RawContext>
pub fn last_ctx(&self) -> Option<&RawContext>
Get the [RawContext
] object from the last [Action
] in the history.
sourcepub fn last_ctx_with_game(&self, game: &Game) -> RawContext
pub fn last_ctx_with_game(&self, game: &Game) -> RawContext
Get the [RawContext
] object from the last [Action
] in the history,
and if the history is empty, create a new [RawContext
] from the game.
Trait Implementations§
source§impl Clone for ActionRecord
impl Clone for ActionRecord
source§fn clone(&self) -> ActionRecord
fn clone(&self) -> ActionRecord
Returns a copy 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 Debug for ActionRecord
impl Debug for ActionRecord
source§impl Default for ActionRecord
impl Default for ActionRecord
source§fn default() -> ActionRecord
fn default() -> ActionRecord
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for ActionRecord
impl<'de> Deserialize<'de> for ActionRecord
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ActionRecord
impl RefUnwindSafe for ActionRecord
impl Send for ActionRecord
impl Sync for ActionRecord
impl Unpin for ActionRecord
impl UnwindSafe for ActionRecord
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)