BuildContext

Struct BuildContext 

Source
pub struct BuildContext {
Show 28 fields pub blob_id: String, pub aligned_chunk: bool, pub blob_offset: u64, pub compressor: Algorithm, pub digester: Algorithm, pub cipher: Algorithm, pub crc32_algorithm: Algorithm, pub explicit_uidgid: bool, pub whiteout_spec: WhiteoutSpec, pub chunk_size: u32, pub batch_size: u32, pub fs_version: RafsVersion, pub has_xattr: bool, pub conversion_type: ConversionType, pub source_path: PathBuf, pub prefetch: Prefetch, pub blob_storage: Option<ArtifactStorage>, pub external_blob_storage: Option<ArtifactStorage>, pub blob_zran_generator: Option<Mutex<ZranContextGenerator<File>>>, pub blob_batch_generator: Option<Mutex<BatchContextGenerator>>, pub blob_tar_reader: Option<BufReaderInfo<File>>, pub blob_features: BlobFeatures, pub blob_inline_meta: bool, pub features: Features, pub configuration: Arc<ConfigV2>, pub blob_cache_generator: Option<BlobCacheGenerator>, pub is_chunkdict_generated: bool, pub attributes: Attributes,
}

Fields§

§blob_id: String

Blob id (user specified or sha256(blob)).

§aligned_chunk: bool

When filling local blobcache file, chunks are arranged as per the decompress_offset within chunk info. Therefore, provide a new flag to image tool thus to align chunks in blob with 4k size.

§blob_offset: u64

Add a offset for compressed blob.

§compressor: Algorithm

Blob chunk compress flag.

§digester: Algorithm

Inode and chunk digest algorithm flag.

§cipher: Algorithm

Blob encryption algorithm flag.

§crc32_algorithm: Algorithm§explicit_uidgid: bool

Save host uid gid in each inode.

§whiteout_spec: WhiteoutSpec

whiteout spec: overlayfs or oci

§chunk_size: u32

Chunk slice size.

§batch_size: u32

Batch chunk data size.

§fs_version: RafsVersion

Version number of output metadata and data blob.

§has_xattr: bool

Whether any directory/file has extended attributes.

§conversion_type: ConversionType

Format conversion type.

§source_path: PathBuf

Path of source to build the image from:

  • Directory: source_path should be a directory path
  • StargzIndex: source_path should be a stargz index json file path
§prefetch: Prefetch

Track file/chunk prefetch state.

§blob_storage: Option<ArtifactStorage>

Storage writing blob to single file or a directory.

§external_blob_storage: Option<ArtifactStorage>§blob_zran_generator: Option<Mutex<ZranContextGenerator<File>>>§blob_batch_generator: Option<Mutex<BatchContextGenerator>>§blob_tar_reader: Option<BufReaderInfo<File>>§blob_features: BlobFeatures§blob_inline_meta: bool§features: Features§configuration: Arc<ConfigV2>§blob_cache_generator: Option<BlobCacheGenerator>

Generate the blob cache and blob meta

§is_chunkdict_generated: bool

Whether is chunkdict.

§attributes: Attributes

Nydus attributes for different build behavior.

Implementations§

Source§

impl BuildContext

Source

pub fn new( blob_id: String, aligned_chunk: bool, blob_offset: u64, compressor: Algorithm, digester: Algorithm, explicit_uidgid: bool, whiteout_spec: WhiteoutSpec, conversion_type: ConversionType, source_path: PathBuf, prefetch: Prefetch, blob_storage: Option<ArtifactStorage>, external_blob_storage: Option<ArtifactStorage>, blob_inline_meta: bool, features: Features, encrypt: bool, attributes: Attributes, ) -> Self

Source

pub fn set_fs_version(&mut self, fs_version: RafsVersion)

Source

pub fn set_chunk_size(&mut self, chunk_size: u32)

Source

pub fn set_batch_size(&mut self, batch_size: u32)

Source

pub fn set_configuration(&mut self, config: Arc<ConfigV2>)

Source

pub fn set_is_chunkdict(&mut self, is_chunkdict: bool)

Source§

impl BuildContext

Source

pub fn v6_block_size(&self) -> u64

Source

pub fn v6_block_addr(&self, offset: u64) -> Result<u32>

Trait Implementations§

Source§

impl Default for BuildContext

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> 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> Same for T

Source§

type Output = T

Should always be Self
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.