pub struct OverlayStore { /* private fields */ }Implementations§
Source§impl OverlayStore
impl OverlayStore
pub fn new() -> Self
Sourcepub fn add(&mut self, overlay: ContextOverlay)
pub fn add(&mut self, overlay: ContextOverlay)
Adds an overlay, replacing any existing overlay with the same target + operation discriminant.
pub fn remove(&mut self, id: &OverlayId)
pub fn for_item(&self, target: &ContextItemId) -> Vec<&ContextOverlay>
pub fn active_for_scope(&self, scope: &OverlayScope) -> Vec<&ContextOverlay>
Sourcepub fn apply_to_state(
&self,
target: &ContextItemId,
current_state: ContextState,
) -> ContextState
pub fn apply_to_state( &self, target: &ContextItemId, current_state: ContextState, ) -> ContextState
Applies all overlays for target to current_state, returning the
effective state. Later overlays take precedence.
Sourcepub fn mark_stale_by_hash(&mut self, target: &ContextItemId, new_hash: &str)
pub fn mark_stale_by_hash(&mut self, target: &ContextItemId, new_hash: &str)
Marks overlays as stale when the source hash has changed.
Sourcepub fn prune_expired(&mut self)
pub fn prune_expired(&mut self)
Removes overlays whose Expire operation has elapsed.
Sourcepub fn history(&self, target: &ContextItemId) -> Vec<&ContextOverlay>
pub fn history(&self, target: &ContextItemId) -> Vec<&ContextOverlay>
Returns all overlays for target, ordered by creation time.
pub fn remove_for_item(&mut self, target: &ContextItemId)
pub fn all(&self) -> &[ContextOverlay]
pub fn save_project(&self, project_root: &Path) -> Result<(), String>
pub fn load_project(project_root: &Path) -> Self
Trait Implementations§
Source§impl Clone for OverlayStore
impl Clone for OverlayStore
Source§fn clone(&self) -> OverlayStore
fn clone(&self) -> OverlayStore
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 OverlayStore
impl Debug for OverlayStore
Source§impl Default for OverlayStore
impl Default for OverlayStore
Source§fn default() -> OverlayStore
fn default() -> OverlayStore
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for OverlayStore
impl<'de> Deserialize<'de> for OverlayStore
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 OverlayStore
impl RefUnwindSafe for OverlayStore
impl Send for OverlayStore
impl Sync for OverlayStore
impl Unpin for OverlayStore
impl UnsafeUnpin for OverlayStore
impl UnwindSafe for OverlayStore
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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