pub struct Address {
pub component: String,
pub occurrence: usize,
pub node_key: Option<String>,
}Expand description
An addressable location in the document.
Fields§
§component: StringComponent name (queue, exchange, backlog, …).
occurrence: usizeZero-based occurrence of the component in the document.
node_key: Option<String>Stable node key when the address is narrowed to a single node; None
addresses the whole component occurrence.
Implementations§
Source§impl Address
impl Address
Sourcepub fn node(component: &str, occurrence: usize, node_key: &str) -> Self
pub fn node(component: &str, occurrence: usize, node_key: &str) -> Self
A node-level address inside a component.
Sourcepub fn from_component_node_key(component: &str, node_key: &str) -> Self
pub fn from_component_node_key(component: &str, node_key: &str) -> Self
Build a node address from a component name and a stable node key,
parsing the component occurrence out of the comp:occurrence:id:n node
key. This is the single source of occurrence parsing shared by
op_address and the finalize-path drift gate, so an op’s address and
the scope’s driver address agree for the same node key.
Sourcepub fn is_component_level(&self) -> bool
pub fn is_component_level(&self) -> bool
True when this address targets a whole component rather than one node.
Sourcepub fn overlaps(&self, other: &Address) -> bool
pub fn overlaps(&self, other: &Address) -> bool
True when two addresses refer to overlapping document regions: the same
component, and either side is component-level (whole component) or both
name the same node key. This is the overlaps primitive behind the
affectedness conflict relation (#op-scoped-drift-3).
Overlap is keyed on the component name plus the node key. The occurrence
field is informational and is intentionally not part of the match: a
node key already encodes the component index (comp:index:id:n), and the
canonical write-set members built by TurnScope::for_driver are
whole-component addresses (occurrence: 0) that must match the component
wherever it sits in the document (#nm1x).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Address
impl<'de> Deserialize<'de> for Address
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>,
impl Eq for Address
impl StructuralPartialEq for Address
Auto Trait Implementations§
impl Forget for Address
impl Freeze for Address
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnsafeUnpin for Address
impl UnwindSafe for Address
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.