Skip to main content

ImportOptions

Struct ImportOptions 

Source
pub struct ImportOptions<'a> {
    pub depth: Depth,
    pub no_ignore: bool,
    pub no_autoprops: bool,
    pub ignore_unknown_node_types: bool,
    pub revprop_table: Option<HashMap<String, String>>,
    pub filter_callback: Option<&'a mut dyn FnMut(&mut bool, &Path, &Dirent) -> Result<(), Error<'static>>>,
    pub commit_callback: Option<&'a mut dyn FnMut(&CommitInfo<'_>) -> Result<(), Error<'static>>>,
}
Expand description

Options for import operations

Fields§

§depth: Depth

Recursion depth.

§no_ignore: bool

If true, don’t use default ignores.

§no_autoprops: bool

If true, don’t use auto-props.

§ignore_unknown_node_types: bool

If true, ignore unknown node types instead of erroring.

§revprop_table: Option<HashMap<String, String>>

Revision properties for the commit.

§filter_callback: Option<&'a mut dyn FnMut(&mut bool, &Path, &Dirent) -> Result<(), Error<'static>>>

Optional filter callback to control which files are imported.

§commit_callback: Option<&'a mut dyn FnMut(&CommitInfo<'_>) -> Result<(), Error<'static>>>

Optional callback to invoke after commit.

Implementations§

Source§

impl<'a> ImportOptions<'a>

Source

pub fn new() -> Self

Creates a new ImportOptions with default values.

Source

pub fn with_depth(self, depth: Depth) -> Self

Sets the depth for the import.

Source

pub fn with_no_ignore(self, no_ignore: bool) -> Self

Sets whether to ignore default ignores.

Source

pub fn with_no_autoprops(self, no_autoprops: bool) -> Self

Sets whether to disable auto-props.

Source

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

Sets whether to ignore unknown node types.

Source

pub fn with_revprop_table(self, revprops: HashMap<String, String>) -> Self

Sets the revision properties.

Source

pub fn with_filter_callback( self, callback: &'a mut dyn FnMut(&mut bool, &Path, &Dirent) -> Result<(), Error<'static>>, ) -> Self

Sets the filter callback.

Source

pub fn with_commit_callback( self, callback: &'a mut dyn FnMut(&CommitInfo<'_>) -> Result<(), Error<'static>>, ) -> Self

Sets the commit callback.

Trait Implementations§

Source§

impl<'a> Default for ImportOptions<'a>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<'a> Freeze for ImportOptions<'a>

§

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

§

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

§

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

§

impl<'a> Unpin for ImportOptions<'a>

§

impl<'a> UnsafeUnpin for ImportOptions<'a>

§

impl<'a> !UnwindSafe for ImportOptions<'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.