Skip to main content

MigrationDirectory

Struct MigrationDirectory 

Source
pub struct MigrationDirectory { /* private fields */ }
Expand description

A retained cross-platform capability for one migration directory.

Every child operation is relative to the open directory handle. The workspace constructor walks each component with no-follow semantics, so a concurrent rename or symlink replacement of the configured pathname cannot redirect later discovery or publication.

Implementations§

Source§

impl MigrationDirectory

Source

pub fn open_ambient(path: &Path) -> Result<Self>

Open an ambient path for compatibility callers of the path-based APIs.

Source

pub fn open_beneath(root: &Path, relative: &Path, create: bool) -> Result<Self>

Open a confined relative directory beneath an ambient root.

Each component is opened without following a final symlink. When create is true, missing components are created relative to the already retained parent handle and then opened under the same rule.

Source

pub fn open_beneath_directory( root: &Dir, relative: &Path, create: bool, ) -> Result<Self>

Open a confined relative directory beneath a retained root capability.

Unlike Self::open_beneath, this never resolves the root through an ambient pathname. Replacing or relinking the name by which the caller originally opened root therefore cannot redirect this operation.

Source

pub fn entries(&self, limit: usize) -> Result<Vec<MigrationDirectoryEntry>>

Enumerate at most limit direct entries through the retained handle.

Source

pub fn open_regular_readonly(&self, name: &OsStr) -> Result<File>

Open one direct regular child for reading without following a symlink.

Source

pub fn open_regular_lock(&self, name: &OsStr) -> Result<File>

Open or create one direct regular read-write child without following a symlink.

Source

pub fn try_acquire_authoring_lock(&self) -> Result<MigrationAuthoringLock<'_>>

Acquire the canonical migration-authoring lock without waiting.

A lock held by another publisher surfaces as io::ErrorKind::WouldBlock on every platform.

Source

pub fn create_new(&self, name: &OsStr) -> Result<File>

Exclusively create one direct regular child without following a symlink.

Source

pub fn entry_exists(&self, name: &OsStr) -> Result<bool>

Return whether any direct entry occupies name, without following it.

Source

pub fn remove_file(&self, name: &OsStr) -> Result<()>

Remove one direct file or symlink entry.

Publish a direct temporary under a direct final name without replacement.

Source

pub fn sync_all(&self) -> Result<()>

Flush directory metadata where the platform exposes that operation.

Trait Implementations§

Source§

impl Debug for MigrationDirectory

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.