Struct conserve::index::IndexEntry

source ·
pub struct IndexEntry {
    pub apath: Apath,
    pub kind: Kind,
    pub mtime: i64,
    pub unix_mode: UnixMode,
    pub owner: Owner,
    pub mtime_nanos: u32,
    pub addrs: Vec<Address>,
    pub target: Option<String>,
}
Expand description

Description of one archived file.

This struct is directly encoded/decoded to the json index file, and also can be constructed by stat-ing (but not reading) a live file.

Fields§

§apath: Apath

Path of this entry relative to the base of the backup, in apath form.

§kind: Kind

Type of file.

§mtime: i64

File modification time, in whole seconds past the Unix epoch.

§unix_mode: UnixMode

Discretionary Access Control permissions (such as read/write/execute on unix)

§owner: Owner

User and Group names of the owners of the file

§mtime_nanos: u32

Fractional nanoseconds for modification time.

This is zero in indexes written prior to 0.6.2, but treating it as zero is harmless - around the transition files will be seen as potentially touched.

It seems moderately common that the nanos are zero, probably because the time was set by something that didn’t preserve them. In that case, skip serializing.

§addrs: Vec<Address>

For stored files, the blocks holding the file contents.

§target: Option<String>

For symlinks only, the target of the symlink.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
source§

impl Entry for IndexEntry

Return apath relative to the top of the tree.

Size of the file, if it is a file. None for directories and symlinks.

Target of the symlink, if this is a symlink.

True if the metadata supports an assumption the file contents have not changed.
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more