pub struct RafsStore { /* private fields */ }Expand description
RAFS-backed image store with Dragonfly-native blob fetching
Uses nydus-storage’s backend-registry for blob operations, which supports
Dragonfly P2P via the blob_redirected_host configuration.
Storage layout:
images/
├── blobs/sha256/ # Layer blobs (content-addressed)
├── bootstrap/ # RAFS metadata (per image)
├── cache/ # nydus-storage blob cache
└── refs/ # Tag → digest symlinksImplementations§
Source§impl RafsStore
impl RafsStore
Sourcepub fn image_fs(
&self,
image_id: &str,
sandbox_dir: &Path,
) -> Result<impl FsMount>
pub fn image_fs( &self, image_id: &str, sandbox_dir: &Path, ) -> Result<impl FsMount>
Build the image FsMount for an image into a per-sandbox directory.
Resolves the image’s RAFS bootstrap and blobs from this store, loads the
RAFS in-process as the read-only lower, and overlays a per-sandbox
writable upper under <sandbox_dir>/rootfs/. See image_fs_for.
Source§impl RafsStore
impl RafsStore
Sourcepub fn new(config: ImageConfig) -> Result<Self>
pub fn new(config: ImageConfig) -> Result<Self>
Create a new RafsStore with configuration
Sourcepub async fn pull_with_auth(
&self,
image_ref: &str,
auth: Option<&GenAuthConfig>,
) -> Result<String>
pub async fn pull_with_auth( &self, image_ref: &str, auth: Option<&GenAuthConfig>, ) -> Result<String>
Pull an image with authentication
Sourcepub async fn ensure(&self, image_ref: &str) -> Result<String>
pub async fn ensure(&self, image_ref: &str) -> Result<String>
Ensure an image is available locally (pull if needed)
Sourcepub fn get_image_id(&self, image_ref: &str) -> Result<String>
pub fn get_image_id(&self, image_ref: &str) -> Result<String>
Get image ID from reference
Sourcepub fn get_metadata(&self, image_ref: &str) -> Result<ImageMetadata>
pub fn get_metadata(&self, image_ref: &str) -> Result<ImageMetadata>
Get image metadata
Sourcepub fn bootstrap_path(&self, image_id: &str) -> PathBuf
pub fn bootstrap_path(&self, image_id: &str) -> PathBuf
Get bootstrap path for an image
Sourcepub fn bootstrap_dir(&self) -> &PathBuf
pub fn bootstrap_dir(&self) -> &PathBuf
Get bootstrap (RAFS metadata) directory
Sourcepub async fn list_images(&self) -> Result<Vec<ImageInfo>>
pub async fn list_images(&self) -> Result<Vec<ImageInfo>>
List all images (CRI ImageClient aligned)
Sourcepub async fn image_status(
&self,
image_ref: &str,
_verbose: bool,
) -> Result<ImageStatusResult>
pub async fn image_status( &self, image_ref: &str, _verbose: bool, ) -> Result<ImageStatusResult>
Get image status (CRI ImageClient aligned)
Sourcepub async fn remove_image(&self, image_ref: &str) -> Result<()>
pub async fn remove_image(&self, image_ref: &str) -> Result<()>
Remove image by reference (CRI ImageClient aligned)
Sourcepub async fn fs_info(&self) -> Result<Vec<FilesystemUsage>>
pub async fn fs_info(&self) -> Result<Vec<FilesystemUsage>>
Get filesystem info (CRI ImageClient aligned)
Trait Implementations§
Source§impl ImageStore for RafsStore
impl ImageStore for RafsStore
Source§fn list_images<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ImageInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_images<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ImageInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn image_status<'life0, 'life1, 'async_trait>(
&'life0 self,
image_ref: &'life1 str,
verbose: bool,
) -> Pin<Box<dyn Future<Output = Result<ImageStatusResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn image_status<'life0, 'life1, 'async_trait>(
&'life0 self,
image_ref: &'life1 str,
verbose: bool,
) -> Pin<Box<dyn Future<Output = Result<ImageStatusResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
image_ref.Source§fn pull_with_auth<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
image_ref: &'life1 str,
auth: Option<&'life2 AuthConfig>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn pull_with_auth<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
image_ref: &'life1 str,
auth: Option<&'life2 AuthConfig>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
image_ref from a registry, optionally with auth. Returns the
resolved image id (content address).Auto Trait Implementations§
impl Freeze for RafsStore
impl !RefUnwindSafe for RafsStore
impl Send for RafsStore
impl Sync for RafsStore
impl Unpin for RafsStore
impl UnsafeUnpin for RafsStore
impl !UnwindSafe for RafsStore
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more