Enum pliantdb_local::backup::Command[][src]

pub enum Command {
    Save {
        output_directory: Option<PathBuf>,
        output_name: Option<String>,
    },
    Load {
        backup: PathBuf,
    },
}

The command to execute.

Variants

Save

Exports all of the data into a straightforward file structure.

This command will create a single folder within output_directory named output_name. Within that folder, one subfolder will be created for each collection collection::Id. Each folder will contain files named <Document.header.id>.<Document.header.revision.id>, and the files will contain the raw bytes stored inside of the documents. Assuming you’re using the built in Serialization, the data will be in the CBOR format, otherwise it will be the bytes you stored within the database.

This format should make it easy to migrate data as well as back it up using many traditional methods, and should be considered the official way to do a full export of a database without using the API.

Fields of Save

output_directory: Option<PathBuf>

The directory to export the data within. The process will create a subfolder using output_name. If omitted, the export is performed next to the source database.

output_name: Option<String>

The name of the folder to export the data to. If not specified, the “.backup” is appended to the source database’s name and used.

Load

Loads all of the data from a previously saved backup. Any documents with the same IDs will be overwritten by the documents in this backup.

Fields of Load

backup: PathBuf

The path to the previously saved backup.

Implementations

impl Command[src]

pub async fn execute(&self, database_path: PathBuf) -> Result<()>[src]

Executes the command.

Trait Implementations

impl Debug for Command[src]

impl StructOpt for Command[src]

impl StructOptInternal for Command[src]

Auto Trait Implementations

impl RefUnwindSafe for Command

impl Send for Command

impl Sync for Command

impl Unpin for Command

impl UnwindSafe for Command

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> Instrument for T[src]

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

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,