#[non_exhaustive]pub struct GridScenario {
pub name: String,
pub layout: GridLayout,
}Expand description
A named GridLayout, for someone to come back to with one click.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringThe name it was saved under.
layout: GridLayoutHow the grid was arranged.
Implementations§
Source§impl GridScenario
impl GridScenario
Sourcepub fn new(name: impl Into<String>, layout: GridLayout) -> Self
pub fn new(name: impl Into<String>, layout: GridLayout) -> Self
A scenario under this name.
Sourcepub fn list_to_json(scenarios: &[Self]) -> String
pub fn list_to_json(scenarios: &[Self]) -> String
A list of scenarios as JSON, to keep in a file or a database.
Sourcepub fn list_from_json(text: &str) -> Result<Vec<Self>, String>
pub fn list_from_json(text: &str) -> Result<Vec<Self>, String>
Reads what list_to_json wrote.
Trait Implementations§
Source§impl Clone for GridScenario
impl Clone for GridScenario
Source§fn clone(&self) -> GridScenario
fn clone(&self) -> GridScenario
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 GridScenario
impl Debug for GridScenario
Source§impl<'de> Deserialize<'de> for GridScenario
impl<'de> Deserialize<'de> for GridScenario
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
Source§impl PartialEq for GridScenario
impl PartialEq for GridScenario
Source§impl Serialize for GridScenario
impl Serialize for GridScenario
impl StructuralPartialEq for GridScenario
Auto Trait Implementations§
impl Freeze for GridScenario
impl RefUnwindSafe for GridScenario
impl Send for GridScenario
impl Sync for GridScenario
impl Unpin for GridScenario
impl UnsafeUnpin for GridScenario
impl UnwindSafe for GridScenario
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