pub struct WorkspaceLease {
pub kind: WorkspaceLeaseKind,
pub repo: Option<String>,
pub target: String,
pub mode: WorkspaceLeaseMode,
}Expand description
Declared claim on a file, directory, crate, or IDE object.
Fields§
§kind: WorkspaceLeaseKindWhat kind of target the lease claims.
repo: Option<String>Owning repo, or None for repo-independent targets such as IDE objects.
target: StringNormalized target path, crate name, or object id.
mode: WorkspaceLeaseModeWhether the claim is a shared read or an exclusive write.
Implementations§
Source§impl WorkspaceLease
impl WorkspaceLease
Sourcepub fn file(repo: impl Into<String>, path: impl Into<String>) -> Self
pub fn file(repo: impl Into<String>, path: impl Into<String>) -> Self
Builds an exclusive-write lease on a file in a repo.
Sourcepub fn directory(repo: impl Into<String>, path: impl Into<String>) -> Self
pub fn directory(repo: impl Into<String>, path: impl Into<String>) -> Self
Builds an exclusive-write lease on a directory subtree in a repo.
Sourcepub fn crate_name(
repo: impl Into<String>,
crate_name: impl Into<String>,
) -> Self
pub fn crate_name( repo: impl Into<String>, crate_name: impl Into<String>, ) -> Self
Builds an exclusive-write lease on a named crate in a repo.
Sourcepub fn ide_object(object_id: Symbol) -> Self
pub fn ide_object(object_id: Symbol) -> Self
Builds an exclusive-write lease on an IDE object by id.
Trait Implementations§
Source§impl Clone for WorkspaceLease
impl Clone for WorkspaceLease
Source§fn clone(&self) -> WorkspaceLease
fn clone(&self) -> WorkspaceLease
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WorkspaceLease
impl Debug for WorkspaceLease
impl Eq for WorkspaceLease
Source§impl PartialEq for WorkspaceLease
impl PartialEq for WorkspaceLease
Source§fn eq(&self, other: &WorkspaceLease) -> bool
fn eq(&self, other: &WorkspaceLease) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for WorkspaceLease
Auto Trait Implementations§
impl Freeze for WorkspaceLease
impl RefUnwindSafe for WorkspaceLease
impl Send for WorkspaceLease
impl Sync for WorkspaceLease
impl Unpin for WorkspaceLease
impl UnsafeUnpin for WorkspaceLease
impl UnwindSafe for WorkspaceLease
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