pub(super) struct ReplacementPolicy {
source: File,
metadata: Metadata,
attributes: Vec<(&'static str, Option<Vec<u8>>)>,
}Expand description
A retained regular destination and its opaque native access policy.
Fields§
§source: FileKeep the snapshotted inode alive through publication.
metadata: MetadataOwnership, mode and filesystem identity associated with that inode.
attributes: Vec<(&'static str, Option<Vec<u8>>)>Supported native attributes, including verified absence.
Implementations§
Source§impl ReplacementPolicy
impl ReplacementPolicy
Sourcepub(super) fn capture(path: &Path, expected: &Metadata) -> Result<Self>
pub(super) fn capture(path: &Path, expected: &Metadata) -> Result<Self>
Snapshot through a no-follow descriptor, without requiring data-read access on write-only files.
Sourcepub(super) fn permissions(&self) -> Permissions
pub(super) fn permissions(&self) -> Permissions
Create a probe with the destination’s ordinary mode, filtered by current umask.
Sourcepub(super) fn matches(&self, file: &File) -> Result<bool>
pub(super) fn matches(&self, file: &File) -> Result<bool>
Prove the complete observable policy already matches, without any setters.
Sourcepub(super) fn verify_destination(&self, path: &Path) -> Result<()>
pub(super) fn verify_destination(&self, path: &Path) -> Result<()>
Refuse replacement after the admitted destination or its captured policy changes.
Sourcepub(super) fn apply(&self, file: &File) -> Result<()>
pub(super) fn apply(&self, file: &File) -> Result<()>
Apply only changed attributes, then prove the complete policy before naming.
Sourcepub(super) fn anonymous_stage(
&self,
builder: &Builder<'_, '_>,
guard: &ProjectStateGuard,
bytes: &[u8],
) -> Result<NamedTempFile>
pub(super) fn anonymous_stage( &self, builder: &Builder<'_, '_>, guard: &ProjectStateGuard, bytes: &[u8], ) -> Result<NamedTempFile>
Prepare the complete replacement while unnamed; only then expose a staging name.
Auto Trait Implementations§
impl Freeze for ReplacementPolicy
impl RefUnwindSafe for ReplacementPolicy
impl Send for ReplacementPolicy
impl Sync for ReplacementPolicy
impl Unpin for ReplacementPolicy
impl UnsafeUnpin for ReplacementPolicy
impl UnwindSafe for ReplacementPolicy
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
§impl<'a, T> FromIn<'a, T> for T
impl<'a, T> FromIn<'a, T> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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