#[non_exhaustive]#[repr(u32)]pub enum ObjectType {
File = 1,
DirTree = 2,
DirMeta = 3,
Commit = 4,
TombstoneCommit = 5,
CommitMeta = 6,
PayloadLink = 7,
FileXattrs = 8,
FileXattrsLink = 9,
}Expand description
A repository object type.
The numeric value of each variant is part of the wire format. It is the
u member of the (su) serialization of an object name and the type byte
of an ostree.sizes entry (SizeEntry).
The values 1 to 9 are the types of the ostree format. A later version can
add other types, so a match on this type needs a wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
File = 1
A content object: a file header and the payload (.file or .filez).
DirTree = 2
The sorted lists of the files and subdirectories of a directory
(.dirtree).
DirMeta = 3
The uid, gid, mode, and xattrs of a directory (.dirmeta).
Commit = 4
A commit: the metadata and the root checksums (.commit).
The root checksums name the root dirtree and the root dirmeta.
TombstoneCommit = 5
A marker of a deleted commit (.tombstone-commit).
CommitMeta = 6
The detached metadata of a commit (.commitmeta).
It can change after the commit.
PayloadLink = 7
A symlink to a .file object (.payload-link).
Its name is the checksum of the payload only.
FileXattrs = 8
A detached xattrs blob (.file-xattrs).
FileXattrsLink = 9
A hardlink to a .file-xattrs object (.file-xattrs-link).
Its name is the checksum of the .file object.
Implementations§
Source§impl ObjectType
impl ObjectType
Sourcepub fn as_u32(self) -> u32
pub fn as_u32(self) -> u32
Returns the numeric value of the type, as the wire format writes it.
Sourcepub fn from_u32(v: u32) -> Result<ObjectType, Error>
pub fn from_u32(v: u32) -> Result<ObjectType, Error>
Returns the type of a numeric value.
§Errors
Error::InvalidObjectType if v is not in the range 1 to 9.
Sourcepub fn is_meta(self) -> bool
pub fn is_meta(self) -> bool
Returns true if the type is a metadata type.
The metadata types are DirTree,
DirMeta, Commit,
TombstoneCommit, and
CommitMeta, with the numeric values 2..=6. The
checksum rules of an object depend on this property. A metadata object
is stored uncompressed, and its loose path never has the z suffix.
Sourcepub fn is_commit_sidecar(self) -> bool
pub fn is_commit_sidecar(self) -> bool
Returns true if the type is a sidecar of a commit.
The sidecar type is CommitMeta. The name of a
sidecar object is the checksum of its commit, and the content of the
sidecar does not go into that checksum.
Sourcepub fn extension(self, mode: RepoMode) -> &'static str
pub fn extension(self, mode: RepoMode) -> &'static str
Returns the loose-path extension of the type in mode.
The extension has no leading dot. The extension of a
File object depends on the mode. It is filez in
archive mode and file in each bare mode. The z suffix occurs only
on a File object in archive mode.
The extensions of the other types do not depend on the mode. The
non-metadata types payload-link, file-xattrs, and
file-xattrs-link are stored uncompressed and have no z suffix.
Sourcepub fn type_str(self) -> &'static str
pub fn type_str(self) -> &'static str
Returns the type string, as the string form of an object name uses it.
The string form is <hexchecksum>.<typestr>. The type string does not
depend on the mode. A File object has the type string file, also in
archive mode, where its loose path has the z suffix. The ostree
command prints the form with no z in its object references.
The type string of each type is its extension in a bare mode.
Sourcepub fn from_extension(ext: &str) -> Option<ObjectType>
pub fn from_extension(ext: &str) -> Option<ObjectType>
Trait Implementations§
Source§impl Clone for ObjectType
impl Clone for ObjectType
Source§fn clone(&self) -> ObjectType
fn clone(&self) -> ObjectType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ObjectType
Source§impl Debug for ObjectType
impl Debug for ObjectType
impl Eq for ObjectType
Source§impl Hash for ObjectType
impl Hash for ObjectType
Source§impl PartialEq for ObjectType
impl PartialEq for ObjectType
impl StructuralPartialEq for ObjectType
Auto Trait Implementations§
impl Forget for ObjectType
impl Freeze for ObjectType
impl Move for ObjectType
impl RefUnwindSafe for ObjectType
impl Send for ObjectType
impl Sync for ObjectType
impl Unpin for ObjectType
impl UnsafeUnpin for ObjectType
impl UnwindSafe for ObjectType
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.