pub struct BackendLockCtxOwned {
pub parent_meta: PathBuf,
pub child_path: String,
}Expand description
Owned counterpart of BackendLockCtx. Provides a convenient way for
tests and callers that don’t otherwise carry a parent-meta + child-path
pair to derive one from a flat dest path: parent_meta = dest.parent(),
child_path = dest.file_name(). Borrow with BackendLockCtxOwned::as_ctx
at the trait-method call site.
v1.3.2 B11 — added so the per-repo backend lock lands under
<parent>/.grex/locks/<name>.backend.lock for callers that have only a
dest path on hand. Production code paths (walker phase1) construct
BackendLockCtx directly with the manifest-declared child.path().
Fields§
§parent_meta: PathBufOwned parent-meta path.
child_path: StringOwned child path (POSIX-style, may contain /).
Implementations§
Source§impl BackendLockCtxOwned
impl BackendLockCtxOwned
Sourcepub fn from_dest(dest: &Path) -> Self
pub fn from_dest(dest: &Path) -> Self
Derive a lock context from a flat dest path. Used by tests that
don’t otherwise carry a parent-meta — dest.parent() plays the
role of parent_meta and dest.file_name() the role of
child_path. Falls back to "." when the parent component is
absent. A missing filename becomes an empty child_path, which the
backend lock path validator rejects instead of silently routing to a
generic "repo" lock.
Sourcepub fn as_ctx(&self) -> BackendLockCtx<'_>
pub fn as_ctx(&self) -> BackendLockCtx<'_>
Borrow as a BackendLockCtx for trait-method call sites.
Trait Implementations§
Source§impl Clone for BackendLockCtxOwned
impl Clone for BackendLockCtxOwned
Source§fn clone(&self) -> BackendLockCtxOwned
fn clone(&self) -> BackendLockCtxOwned
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 BackendLockCtxOwned
impl RefUnwindSafe for BackendLockCtxOwned
impl Send for BackendLockCtxOwned
impl Sync for BackendLockCtxOwned
impl Unpin for BackendLockCtxOwned
impl UnsafeUnpin for BackendLockCtxOwned
impl UnwindSafe for BackendLockCtxOwned
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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