Skip to main content

PolicyArgs

Struct PolicyArgs 

Source
pub struct PolicyArgs {
Show 17 fields pub compression: Option<String>, pub splitter: Option<String>, pub ignore: Vec<String>, pub never_compress: Vec<String>, pub ignore_cache_dirs: Option<bool>, pub ignore_file_errors: Option<bool>, pub ignore_dir_errors: Option<bool>, pub ignore_unknown_types: Option<bool>, pub max_parallel_snapshots: Option<u32>, pub max_parallel_file_reads: Option<u32>, pub keep_latest: Option<i64>, pub keep_hourly: Option<i64>, pub keep_daily: Option<i64>, pub keep_weekly: Option<i64>, pub keep_monthly: Option<i64>, pub keep_annual: Option<i64>, pub extra_args: Vec<String>,
}
Expand description

Policy fields kopia applies via kopia policy set. Mirrors the operator’s SnapshotPolicy.spec.policy without depending on the api crate, so the kopia crate stays controller-agnostic. The caller translates the CRD policy into this and the controller applies it before the first snapshot.

Fields§

§compression: Option<String>

--compression algorithm (e.g. zstd, none).

§splitter: Option<String>

--splitter algorithm.

§ignore: Vec<String>

--add-ignore glob patterns.

§never_compress: Vec<String>

--add-never-compress glob patterns.

§ignore_cache_dirs: Option<bool>

--ignore-cache-dirs tri-state (honor CACHEDIR.TAG). None leaves kopia’s default.

§ignore_file_errors: Option<bool>

Backup-side error handling (--ignore-file-errors) tri-state. ADR-0005 §13(b).

§ignore_dir_errors: Option<bool>

--ignore-dir-errors tri-state. ADR-0005 §13(b).

§ignore_unknown_types: Option<bool>

--ignore-unknown-types tri-state. ADR-0005 §13(b).

§max_parallel_snapshots: Option<u32>

--max-parallel-snapshots upload parallelism. ADR-0005 §13(f).

§max_parallel_file_reads: Option<u32>

--max-parallel-file-reads upload parallelism. ADR-0005 §13(f).

§keep_latest: Option<i64>

--keep-latest: most-recent-N backups to keep per source.

This field (and its five siblings below) exists ONLY so the mover can pin kopia’s own create-time retention to effectively-infinite at the identity scope — see kopiur_mover::workspec::KOPIA_KEEP_MAX’s doc comment for the full hazard. There is deliberately no CRD/workspec surface that lets a user set these: kopia-side retention stays forbidden (crates/api/src/error.rs’s InlineRetentionForbidden), and PolicyArgsSpec::to_kopia never populates them.

§keep_hourly: Option<i64>

--keep-hourly. See Self::keep_latest.

§keep_daily: Option<i64>

--keep-daily. See Self::keep_latest.

§keep_weekly: Option<i64>

--keep-weekly. See Self::keep_latest.

§keep_monthly: Option<i64>

--keep-monthly. See Self::keep_latest.

§keep_annual: Option<i64>

--keep-annual. See Self::keep_latest.

§extra_args: Vec<String>

Verbatim extra policy set flags (the CRD escape hatch).

Trait Implementations§

Source§

impl Clone for PolicyArgs

Source§

fn clone(&self) -> PolicyArgs

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 PolicyArgs

Source§

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

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

impl Default for PolicyArgs

Source§

fn default() -> PolicyArgs

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

impl PartialEq for PolicyArgs

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for PolicyArgs

Source§

impl StructuralPartialEq for PolicyArgs

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

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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, 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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more