pub struct WatcherSubscriptions {
pub server_id: Arc<str>,
/* private fields */
}Expand description
Snapshot of every active file-watcher registration for one
server. Built by compile_for_server from the dynamic
registry; consumed by the host’s notify-driven dispatcher.
Each match request walks the per-watcher kind bitmask; the
compiled GlobSet runs N patterns in one pass.
Fields§
§server_id: Arc<str>Server-stable id (e.g. "rust-analyzer"). Lets the
dispatcher route the FileEvent batch back to the right
ServerHandle. Cheap clone via Arc<str>.
Implementations§
Source§impl WatcherSubscriptions
impl WatcherSubscriptions
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
True when this server has no active watcher registrations. Cheap pre-check the dispatcher runs before walking the globset on every fs event.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Number of compiled watcher entries. Each entry was one
FileSystemWatcher in a DidChangeWatchedFilesRegistrationOptions
batch; one registration with two watchers produces two
entries here.
Sourcepub fn matches(
&self,
absolute_path: &Path,
change: FileChangeType,
) -> Vec<usize>
pub fn matches( &self, absolute_path: &Path, change: FileChangeType, ) -> Vec<usize>
Match an absolute path against the subscription set.
Returns the list of [lsp_types::FileEvent]s the server
would expect for the given change kind – empty when no
watcher matches OR every matching watcher has the change
kind masked out.
Per LSP spec the event uses the server’s URI shape; the
caller converts path to a file:// URI before emitting
the notification.
Sourcepub fn fingerprint(&self) -> u64
pub fn fingerprint(&self) -> u64
Identity fingerprint – a hash of every (base, pattern, kind) tuple. The dispatcher caches this per server so a no-op tick (registry unchanged) skips the notify-watcher rebuild.
Sourcepub fn base_paths(&self) -> impl Iterator<Item = &Path> + '_
pub fn base_paths(&self) -> impl Iterator<Item = &Path> + '_
Borrow each watcher’s declared base path. Used by the
dispatcher to compute the union of paths the
notify::RecommendedWatcher must subscribe to.
Trait Implementations§
Source§impl Clone for WatcherSubscriptions
impl Clone for WatcherSubscriptions
Source§fn clone(&self) -> WatcherSubscriptions
fn clone(&self) -> WatcherSubscriptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for WatcherSubscriptions
impl RefUnwindSafe for WatcherSubscriptions
impl Send for WatcherSubscriptions
impl Sync for WatcherSubscriptions
impl Unpin for WatcherSubscriptions
impl UnsafeUnpin for WatcherSubscriptions
impl UnwindSafe for WatcherSubscriptions
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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