pub struct ModelLayers { /* private fields */ }Expand description
The generated model and the layers over it. Taking a setting off a layer brings back what the layer below says.
Implementations§
Source§impl ModelLayers
impl ModelLayers
Sourcepub fn set(
&mut self,
layer: &ModelLayer,
path: &[&str],
name: &str,
value: Json,
)
pub fn set( &mut self, layer: &ModelLayer, path: &[&str], name: &str, value: Json, )
A setting at this path of ids, on this layer.
Sourcepub fn clear(&mut self, layer: &ModelLayer, path: &[&str], name: &str)
pub fn clear(&mut self, layer: &ModelLayer, path: &[&str], name: &str)
Takes the setting off this layer, so the one below answers again.
Sourcepub fn put(&mut self, layer: &ModelLayer, difference: Diff)
pub fn put(&mut self, layer: &ModelLayer, difference: Diff)
Puts a whole difference on this layer, replacing what it held.
Sourcepub fn difference(&self, layer: &ModelLayer) -> Option<&Diff>
pub fn difference(&self, layer: &ModelLayer) -> Option<&Diff>
What this layer holds.
Sourcepub fn merged(&self) -> MergedModel
pub fn merged(&self) -> MergedModel
The model, from the bottom up. What finds no node goes to the unusable list, and stays in its difference.
Sourcepub fn load(
&mut self,
layer: &ModelLayer,
store: &dyn ModelStore,
) -> Result<(), ModelError>
pub fn load( &mut self, layer: &ModelLayer, store: &dyn ModelStore, ) -> Result<(), ModelError>
Reads this layer from a store, if the store has it.
Sourcepub fn save(
&self,
layer: &ModelLayer,
store: &dyn ModelStore,
) -> Result<(), ModelError>
pub fn save( &self, layer: &ModelLayer, store: &dyn ModelStore, ) -> Result<(), ModelError>
Writes this layer to a store.
Trait Implementations§
Source§impl Clone for ModelLayers
impl Clone for ModelLayers
Source§fn clone(&self) -> ModelLayers
fn clone(&self) -> ModelLayers
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 ModelLayers
impl Debug for ModelLayers
Source§impl PartialEq for ModelLayers
impl PartialEq for ModelLayers
impl StructuralPartialEq for ModelLayers
Auto Trait Implementations§
impl Freeze for ModelLayers
impl RefUnwindSafe for ModelLayers
impl Send for ModelLayers
impl Sync for ModelLayers
impl Unpin for ModelLayers
impl UnsafeUnpin for ModelLayers
impl UnwindSafe for ModelLayers
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