pub struct ShareModeTable {
opens: Mutex<HashMap<String, Vec<OpenMode>>>,
}Expand description
Server-wide table of open share modes, keyed by on-disk path, used to detect sharing violations ([MS-FSA] §2.1.5.1) across all connections.
Fields§
§opens: Mutex<HashMap<String, Vec<OpenMode>>>Implementations§
Sourcepub fn try_open(
&self,
path: &str,
access: u32,
share: u32,
owner: LockOwner,
) -> bool
pub fn try_open( &self, path: &str, access: u32, share: u32, owner: LockOwner, ) -> bool
Record a new open if it is compatible with every existing open on the same file; returns false (registering nothing) on a sharing violation.
Sourcepub fn close_session(&self, session_id: u64)
pub fn close_session(&self, session_id: u64)
Drop every open recorded for any handle of session_id.
Sourcepub fn open_count(&self, path: &str) -> usize
pub fn open_count(&self, path: &str) -> usize
Number of opens currently recorded for path.
Sourcepub fn has_open_under(&self, dir: &str, exclude: LockOwner) -> bool
pub fn has_open_under(&self, dir: &str, exclude: LockOwner) -> bool
True when any open exists on a strict descendant of dir, or on dir
itself by an open other than exclude. A directory rename fails while
such a subtree handle is held ([MS-FSA] §2.1.5.14.2).
Trait Implementations§
Source§fn default() -> ShareModeTable
fn default() -> ShareModeTable
Returns the “default value” for a type. Read more
Auto Trait Implementations§
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