pub struct Memento {
name: String,
text: String,
}
Expand description
Represents a single memento (snapshot) of the text state before an operation is applied. The operation becomes the name of the memento for display purposes.
Fields§
§name: String
The name of this memento (really just the name of the operation that triggered the need for this memento).
text: String
The snapshot of the text data as stored in the MementoTextObject struct instance.
Implementations§
source§impl Memento
impl Memento
sourcefn new(name: &str, text: &str) -> Memento
fn new(name: &str, text: &str) -> Memento
Constructor.
Parameters
-
name
The name of the memento to create
-
text
The data to be saved in the memento
Returns
Returns a new instance of the Memento struct.