pub struct DeltaOptions {
pub min_fallback_size: u64,
pub max_bsdiff_size: u64,
pub max_chunk_size: u64,
pub bsdiff: bool,
pub timestamp: Option<u64>,
pub output_dir: Option<PathBuf>,
pub superblock_file: Option<PathBuf>,
pub signers: Vec<Arc<dyn Signer>>,
pub inline: bool,
pub endianness: DeltaEndianness,
}Expand description
The options of Repo::generate_static_delta.
The three size thresholds are the thresholds of the ostree static-delta generate command, in bytes. The ostree command takes decimal megabytes:
pass 4 * 1_000_000 where the command takes --min-fallback-size=4.
Fields§
§min_fallback_size: u64The stream size at which an object travels as a loose fallback.
The stream is the file header and the content, uncompressed. If the
stream of an object is this size or larger, the object is not packed
into a part and is never diffed. The size compared is the serialized
file header, plus 7 bytes, plus the content, as the ostree command
compares it.
Default 4,000,000. Zero turns fallbacks off for content objects, as
--min-fallback-size=0 of the ostree command does. Each content
object is then packed whatever its size, and the memory of a diff has
no bound from this value.
max_bsdiff_size: u64The largest content size for which a bspatch stream is tried.
The suffix sort of bsdiff costs several times the source size in memory, on top of the two objects, so this value bounds the peak. Default 64,000,000. A second bound of 64 KiB comes from the largest chunk of the chunker, and the smaller bound applies. At the default, the 64 KiB bound decides. Both bounds apply to the source object and to the target object.
max_chunk_size: u64The payload size at which a part closes and the next part starts.
Default 32,000,000. Zero is refused with Error::InvalidFormat.
bsdiff: boolThe switch that allows bspatch streams.
If false, an object that chunking cannot express is spliced whole.
Default true.
timestamp: Option<u64>The superblock timestamp, in seconds since the Unix epoch.
None uses the current time, as the ostree command does. A fixed
value makes the output reproducible for one liblzma version.
The generation packs the metadata objects first, by object type and then by checksum, and then the content objects by checksum. So one input gives the same parts. Each part is the output of liblzma at xz preset 8, and another liblzma version can write other bytes.
output_dir: Option<PathBuf>A directory that receives the superblock and the part files.
If set, no file goes into the deltas/ tree. The generation creates
the directory if it is absent.
The generation replaces the files that this delta writes and removes no other file. The extra part files of a longer previous delta stay. A reader takes only the parts that the superblock lists, so these files cost disk space and cause no error.
superblock_file: Option<PathBuf>A file path for the superblock, with the part files in its directory.
If set, no file goes into the deltas/ tree. A path with no / puts
the superblock and the parts in the working directory. The directory
must exist, and the generation does not create it. None by default.
The generation refuses these paths before it writes a file:
- a path that names a directory
- a path whose last component is empty,
., or.. - a path whose last component is a part file name, such as
0or1
Only the rename that puts the superblock in place replaces a file at
the path. If the generation fails, that file stays as it was. If
output_dir is also set, the generation is
refused.
signers: Vec<Arc<dyn Signer>>The engines that sign the superblock before it is written.
Each engine signs once, in order. Empty by default, which writes an
unsigned superblock. If a signer fails, the generation fails and writes
no superblock. The X.509 chains and CRLs that
Signer::x509_attachments of a signer gives go into the signature
dict of the envelope after its signature, with
append_x509.
inline: boolThe switch that puts the parts into the superblock.
If true, the metadata dict of the superblock holds each part under
the key deltas/<fanout>/<rest>/<i>, as a (yay) variant, and no part
file is written. The value holds the bytes that a part file holds. The
key is the repository-relative name, also with
output_dir or
superblock_file.
The parts count toward the superblock limit of 128 MiB. If the
superblock passes the limit, the generation fails before it writes
the superblock. A superblock that an earlier delta left at the same
location then stays in place. Default false.
endianness: DeltaEndiannessThe byte order of the size fields of the superblock.
The superblock records the order in ostree.endianness. The order
applies to the size and the usize of a meta-entry and to the two
sizes of a fallback. The timestamp, the parts, and the embedded commit
do not change with it. Default DeltaEndianness::Little, on each
host.
Trait Implementations§
Source§impl Clone for DeltaOptions
impl Clone for DeltaOptions
Source§impl Debug for DeltaOptions
impl Debug for DeltaOptions
Auto Trait Implementations§
impl !RefUnwindSafe for DeltaOptions
impl !UnwindSafe for DeltaOptions
impl Forget for DeltaOptions
impl Freeze for DeltaOptions
impl Move for DeltaOptions
impl Send for DeltaOptions
impl Sync for DeltaOptions
impl Unpin for DeltaOptions
impl UnsafeUnpin for DeltaOptionswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Arc<dyn Signer>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.