pub struct Location(/* private fields */);Expand description
The identity/coordinate primitives — change id, epoch, location — are owned by
tributary-proto and re-exported from there directly (tributary-fs merely
re-exports them itself). The per-watch Interest is not among them: the
umbrella owns its own source-neutral mask (aligned to EventKind), and the
proto/fs Interest stays a purely fs-internal arm mask for consumers driving a raw
fs watcher.
A canonical location: the sequence of Segments from a watched root to a
target.
An empty location denotes the watched root itself. The core reconstructs a location by walking the parent-relative watch tree, so a location is always rooted at a disjoint scope root rather than at the filesystem root.
Implementations§
Source§impl Location
impl Location
Sourcepub fn from_segments(segments: impl IntoIterator<Item = Segment>) -> Location
pub fn from_segments(segments: impl IntoIterator<Item = Segment>) -> Location
Builds a location from a sequence of canonical segments.
Sourcepub fn name(&self) -> Option<&Segment>
pub fn name(&self) -> Option<&Segment>
The final segment (the target’s own name), or None for the root.
Sourcepub fn child(self, segment: Segment) -> Location
pub fn child(self, segment: Segment) -> Location
Returns this location with segment appended (builder form).
Sourcepub fn join(self, suffix: &Location) -> Location
pub fn join(self, suffix: &Location) -> Location
Returns this location extended with every segment of suffix, descending
through it (builder form).
Sourcepub fn starts_with(&self, prefix: &Location) -> bool
pub fn starts_with(&self, prefix: &Location) -> bool
Whether this location lies within prefix’s subtree — prefix names this
location itself or one of its ancestors (prefix-inclusive: every location
starts with itself, and everything starts with the empty root location).