Enum IndexScope
pub enum IndexScope {
Relative(ID),
Nested(ID),
Root(Arc<str>),
}Expand description
Struct describing context in which StickyIndex is placed. For items pointing inside of the shared typed sequence it’s always [StickyIndex::Relative] which refers to a block ID found under corresponding position.
In case when a containing collection is empty, there’s a no block ID that can be used as point of reference. In that case we store either a parent collection root type name or its branch ID instead (if collection is nested into another).
Using IDs guarantees that corresponding StickyIndex doesn’t shift under incoming concurrent updates.
Variants§
Relative(ID)
StickyIndex is relative to a given block ID. This happens whenever we set StickyIndex somewhere inside the non-empty shared collection.
Nested(ID)
If a containing collection is a nested y-type, which is empty, this case allows us to identify that nested type.
Root(Arc<str>)
If a containing collection is a root-level y-type, which is empty, this case allows us to identify that nested type.
Implementations§
§impl IndexScope
impl IndexScope
pub fn from_branch(branch: BranchPtr) -> IndexScope
Trait Implementations§
§impl Clone for IndexScope
impl Clone for IndexScope
§fn clone(&self) -> IndexScope
fn clone(&self) -> IndexScope
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for IndexScope
impl Debug for IndexScope
§impl Decode for IndexScope
impl Decode for IndexScope
§impl<'de> Deserialize<'de> for IndexScope
impl<'de> Deserialize<'de> for IndexScope
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<IndexScope, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<IndexScope, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Encode for IndexScope
impl Encode for IndexScope
§impl Hash for IndexScope
impl Hash for IndexScope
§impl Ord for IndexScope
impl Ord for IndexScope
§impl PartialEq for IndexScope
impl PartialEq for IndexScope
§impl PartialOrd for IndexScope
impl PartialOrd for IndexScope
§impl Serialize for IndexScope
impl Serialize for IndexScope
§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,
impl Eq for IndexScope
impl StructuralPartialEq for IndexScope
Auto Trait Implementations§
impl Freeze for IndexScope
impl RefUnwindSafe for IndexScope
impl Send for IndexScope
impl Sync for IndexScope
impl Unpin for IndexScope
impl UnwindSafe for IndexScope
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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