Skip to main content

LoadOptions

Struct LoadOptions 

Source
pub struct LoadOptions<'a> {
    pub start_rev: Option<Revnum>,
    pub end_rev: Option<Revnum>,
    pub uuid_action: LoadUUID,
    pub parent_dir: Option<&'a str>,
    pub use_pre_commit_hook: bool,
    pub use_post_commit_hook: bool,
    pub validate_props: bool,
    pub ignore_dates: bool,
    pub normalize_props: bool,
    pub notify_func: Option<&'a dyn Fn(&Notify<'_>)>,
    pub cancel_func: Option<&'a dyn Fn() -> Result<(), Error<'static>>>,
}
Expand description

Options for repository load operations.

Fields§

§start_rev: Option<Revnum>

Starting revision (None for all revisions).

§end_rev: Option<Revnum>

Ending revision (None for all revisions).

§uuid_action: LoadUUID

How to handle UUID from dump stream.

§parent_dir: Option<&'a str>

Parent directory to load into (None for root).

§use_pre_commit_hook: bool

If true, run pre-commit hook for each loaded revision.

§use_post_commit_hook: bool

If true, run post-commit hook for each loaded revision.

§validate_props: bool

If true, validate properties.

§ignore_dates: bool

If true, ignore dates from dump and use current time.

§normalize_props: bool

If true, normalize properties (e.g., line endings).

§notify_func: Option<&'a dyn Fn(&Notify<'_>)>

Optional notification callback.

§cancel_func: Option<&'a dyn Fn() -> Result<(), Error<'static>>>

Optional cancellation callback.

Implementations§

Source§

impl<'a> LoadOptions<'a>

Source

pub fn new() -> Self

Creates new LoadOptions with default values.

Source

pub fn with_start_rev(self, rev: Revnum) -> Self

Sets the starting revision.

Source

pub fn with_end_rev(self, rev: Revnum) -> Self

Sets the ending revision.

Source

pub fn with_uuid_action(self, action: LoadUUID) -> Self

Sets how to handle UUID from dump stream.

Source

pub fn with_parent_dir(self, dir: &'a str) -> Self

Sets the parent directory to load into.

Source

pub fn with_use_pre_commit_hook(self, use_hook: bool) -> Self

Sets whether to run pre-commit hooks.

Source

pub fn with_use_post_commit_hook(self, use_hook: bool) -> Self

Sets whether to run post-commit hooks.

Source

pub fn with_validate_props(self, validate: bool) -> Self

Sets whether to validate properties.

Source

pub fn with_ignore_dates(self, ignore: bool) -> Self

Sets whether to ignore dates from dump.

Source

pub fn with_normalize_props(self, normalize: bool) -> Self

Sets whether to normalize properties.

Trait Implementations§

Source§

impl<'a> Default for LoadOptions<'a>

Source§

fn default() -> LoadOptions<'a>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for LoadOptions<'a>

§

impl<'a> !RefUnwindSafe for LoadOptions<'a>

§

impl<'a> !Send for LoadOptions<'a>

§

impl<'a> !Sync for LoadOptions<'a>

§

impl<'a> Unpin for LoadOptions<'a>

§

impl<'a> UnsafeUnpin for LoadOptions<'a>

§

impl<'a> !UnwindSafe for LoadOptions<'a>

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
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> 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.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.