Skip to main content

CreateOptions

Struct CreateOptions 

Source
pub struct CreateOptions { /* private fields */ }
Expand description

A builder for configuring a new litebox.

Implementations§

Source§

impl CreateOptions

Source

pub fn new() -> Self

Create a new CreateOptions with default settings.

Source

pub fn compression(self, enabled: bool) -> Self

Enable or disable file compression.

This compresses data to reduce storage usage at the cost of performance.

The default value is false.

§See Also
Source

pub fn chunking(self, enabled: bool) -> Self

Enable or disable content-defined chunking.

This deduplicates data at the sub-file level to reduce storage usage for similar files at the cost of performance.

The default value is false.

§See Also
Source

pub fn encryption_secret(self, secret: EncryptionSecret) -> Self

Encrypt the litebox with the given secret via SQLCipher.

Source

pub fn block_size(self, bytes: usize) -> Self

Change the block size from its default.

The block size has implications for performance, storage efficiency, and memory usage. The correct value depends on your workload.

The block size must be a power of 2 between 16 KiB and 128 KiB, however these limits may change in future versions. A value outside this range will be clamped to the nearest bound. A value that is not a power of 2 will be rounded down to the nearest power of 2.

The default block size is currently 32 KiB, however this may change in future versions.

Source

pub fn skip_application_id(self, skip: bool) -> Self

Skip setting the SQLite application_id.

By default, creating a litebox sets the SQLite application_id to the magic number 0x6c626f78 (b"lbox"). If you are using LiteboxFS to implement your own application file format, you may want to set the application_id yourself.

The default value is false.

§See Also

Trait Implementations§

Source§

impl Clone for CreateOptions

Source§

fn clone(&self) -> CreateOptions

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 CreateOptions

Source§

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

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

impl Default for CreateOptions

Source§

fn default() -> Self

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

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.

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.