Enum memfile::Seal[][src]

#[repr(u32)]
#[non_exhaustive]pub enum Seal {
    Seal,
    Shrink,
    Grow,
    Write,
    FutureWrite,
}

A seal that prevents certain actions from being performed on a file.

Note that seals apply to a file, not a file descriptor. If two file descriptors refer to the same file, they share the same set of seals.

Seals can not be removed from a file once applied.

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Seal

Prevent adding more seals to the file.

Shrink

Prevent the file from being shrunk with truncate or similar.

Combine with Seal::Grow to prevent the file from being resized in any way.

Grow

Prevent the file from being extended with truncate, fallocate or simillar.

Combine with Seal::Shrink to prevent the file from being resized in any way.

Write

Prevent write to the file.

This will block all writes to the file and prevents any shared, writable memory mappings from being created.

If a shared, writable memory mapping already exists, adding this seal will fail.

FutureWrite

Similar to Seal::Write, but allows existing shared, writable memory mappings to modify the file contents.

This can be used to share a read-only view of the file with other processes, while still being able to modify the contents through an existing mapping.

Trait Implementations

impl BitAnd<Seal> for Seal[src]

type Output = Seals

The resulting type after applying the & operator.

impl BitAnd<Seals> for Seal[src]

type Output = Seals

The resulting type after applying the & operator.

impl BitOr<Seal> for Seal[src]

type Output = Seals

The resulting type after applying the | operator.

impl BitOr<Seals> for Seal[src]

type Output = Seals

The resulting type after applying the | operator.

impl BitXor<Seal> for Seal[src]

type Output = Seals

The resulting type after applying the ^ operator.

impl BitXor<Seals> for Seal[src]

type Output = Seals

The resulting type after applying the ^ operator.

impl Clone for Seal[src]

impl Copy for Seal[src]

impl Debug for Seal[src]

impl Eq for Seal[src]

impl From<Seal> for Seals[src]

impl Hash for Seal[src]

impl Ord for Seal[src]

impl PartialEq<Seal> for Seal[src]

impl PartialOrd<Seal> for Seal[src]

impl StructuralEq for Seal[src]

impl StructuralPartialEq for Seal[src]

impl Sub<Seal> for Seal[src]

type Output = Seals

The resulting type after applying the - operator.

impl Sub<Seals> for Seal[src]

type Output = Seals

The resulting type after applying the - operator.

Auto Trait Implementations

impl RefUnwindSafe for Seal

impl Send for Seal

impl Sync for Seal

impl Unpin for Seal

impl UnwindSafe for Seal

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.