Skip to main content

DbSchema

Enum DbSchema 

Source
pub enum DbSchema {
    V9(SchemaVersion),
}
Expand description

Describes supported schema versions of the ALPM databases.

Variants§

§

V9(SchemaVersion)

Schema version 9 as introduced with pacman 4.2.0 on 2014-12-19.

Implementations§

Source§

impl DbSchema

Source

pub const VERSION_FILE_NAME: &str = "ALPM_DB_VERSION"

The name of the schema version file in an alpm-db database.

Source

pub(crate) fn write_version_file_to_db_root( &self, base_path: impl AsRef<Path>, ) -> Result<(), Error>

Writes the schema version to the default version file in the database root path.

§Errors

Returns an error if the version file cannot be written.

Trait Implementations§

Source§

impl AsRef<SchemaVersion> for DbSchema

Source§

fn as_ref(&self) -> &SchemaVersion

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for DbSchema

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DbSchema

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for DbSchema

Source§

fn default() -> Self

Returns the latest supported schema version.

Source§

impl Display for DbSchema

Source§

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

Formats the schema version as a string.

Uses only the major version number of the underlying SchemaVersion.

Source§

impl Eq for DbSchema

Source§

impl FileFormatSchema for DbSchema

Source§

fn derive_from_file(file: impl AsRef<Path>) -> Result<Self, Self::Err>
where Self: Sized,

Derives a DbSchema from a version file.

Opens the file and defers to DbSchema::derive_from_reader.

§Errors

Returns an error if:

  • the file cannot be opened for reading,
  • or deriving a DbSchema from its contents fails.
Source§

fn derive_from_reader(reader: impl Read) -> Result<Self, Self::Err>
where Self: Sized,

Derives a DbSchema from a reader.

Reads the reader to a string and defers to DbSchema::derive_from_str.

§Errors

Returns an error if:

  • reading from reader fails,
  • or deriving a DbSchema from its contents fails.
Source§

fn derive_from_str(s: &str) -> Result<Self, Self::Err>
where Self: Sized,

Derives a DbSchema from a string containing the schema version.

§Errors

Returns an error if deriving a DbSchema from the string fails.

Source§

type Err = Error

The Error type to use.
Source§

impl FromStr for DbSchema

Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a DbSchema from a string containing the schema version.

§Errors

Returns an error if deriving a DbSchema from the string fails.

Source§

type Err = Error

The associated error which can be returned from parsing.
Source§

impl PartialEq for DbSchema

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DbSchema

Source§

impl TryFrom<SchemaVersion> for DbSchema

Source§

fn try_from(value: SchemaVersion) -> Result<Self, Self::Error>

Tries to convert a SchemaVersion into a DbSchema.

§Errors

Returns an error if the given schema version is not supported.

Source§

type Error = Error

The type returned in the event of a conversion error.

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
§

impl<T> AnyEq for T
where T: Any + PartialEq,

§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

§

fn as_any(&self) -> &(dyn Any + 'static)

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.