pub struct OverlayStore { /* private fields */ }Implementations§
Source§impl OverlayStore
impl OverlayStore
pub fn new() -> OverlayStore
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)
Sourcepub fn retain(&mut self, keep: impl FnMut(&ContextOverlay) -> bool) -> usize
pub fn retain(&mut self, keep: impl FnMut(&ContextOverlay) -> bool) -> usize
Keeps only the overlays keep accepts; returns how many were removed.
(Ids are target + millisecond, so overlays set together can share one:
select by content, not by Self::remove.)
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) -> OverlayStore
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<OverlayStore, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OverlayStore, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for OverlayStore
impl Serialize for OverlayStore
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Forget for OverlayStore
impl Freeze for OverlayStore
impl Move for OverlayStore
impl RefUnwindSafe for OverlayStore
impl Send for OverlayStorewhere
RawVecInner: Send,
impl Sync for OverlayStorewhere
RawVecInner: Sync,
impl Unpin for OverlayStore
impl UnsafeUnpin for OverlayStore
impl UnwindSafe for OverlayStorewhere
RawVecInner: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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