Struct dochy_archiver::ArchiveOptions[][src]

pub struct ArchiveOptions { /* fields omitted */ }

Customize how we build the archive.

If you need the default value, you can get it with new()

use dochy_archiver::ArchiveOptions;

// construct with the default values.
// In the default configuration, every file is archived in the folder and the subfolders.
let op = ArchiveOptions::new();

If you want to customize, you can use the builder.

Appending "..Default::default()" could make your source code compatible with the future versions of this library.

use dochy_archiver::ArcResult;
use dochy_archiver::{ArchiveOptions, ArchiveOptionsBuilder};

fn main() -> ArcResult<()>{
let op = ArchiveOptions::from(
        ArchiveOptionsBuilder {
            extensions_archived : vec![".json5"],
            archive_subfolders : false,
            ..Default::default()
       })?;
    Ok(())
}

Implementations

impl ArchiveOptions[src]

pub fn is_archived(&self, extension: &str) -> bool[src]

Should the file with the extension be archived?

pub fn archive_subfolders(&self) -> bool[src]

Should the subfolders be archived?

pub fn new() -> ArchiveOptions[src]

construct with the default values. In the default configuration, every file is archived in the folder and the subfolders.

pub fn from(builder: ArchiveOptionsBuilder<'_>) -> ArcResult<ArchiveOptions>[src]

Construct ArchiveOptions from the builder

Trait Implementations

impl Clone for ArchiveOptions[src]

impl Debug for ArchiveOptions[src]

Auto Trait Implementations

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.