pub struct ContainerRegistryBuilder { /* private fields */ }
Expand description
Builder for a new instance of the container registry.
Requires a storage to be set, either by calling Self::storage
or constructing using
Self::build_for_testing()
, which requires the test-support
feature and will use
a temporary directory.
By default, no hooks are set up and the auth provider requires authentication, but does not grant access to anything.
Implementations§
Source§impl ContainerRegistryBuilder
impl ContainerRegistryBuilder
Sourcepub fn build_for_testing(self) -> TestingContainerRegistry
pub fn build_for_testing(self) -> TestingContainerRegistry
Constructs a new registry for testing purposes.
Similar to Self::build
, except
- If no auth provider has been set, a default one granting full write access to any user, including anonymous ones.
- If no storage path has been set, creates a temporary directory for the registry, which
will be cleaned up if
TestingContainerRegistry
is dropped.
§Panics
Will panic if filesystem operations when setting up storage fail.
Source§impl ContainerRegistryBuilder
impl ContainerRegistryBuilder
Sourcepub fn auth_provider(self, auth_provider: Arc<dyn AuthProvider>) -> Self
pub fn auth_provider(self, auth_provider: Arc<dyn AuthProvider>) -> Self
Sets the auth provider for the new registry.
Sourcepub fn hooks(self, hooks: Box<dyn RegistryHooks>) -> Self
pub fn hooks(self, hooks: Box<dyn RegistryHooks>) -> Self
Sets hooks for the new registry to call.
Sourcepub fn build(self) -> Result<Arc<ContainerRegistry>, FilesystemStorageError>
pub fn build(self) -> Result<Arc<ContainerRegistry>, FilesystemStorageError>
Trait Implementations§
Source§impl Default for ContainerRegistryBuilder
impl Default for ContainerRegistryBuilder
Source§fn default() -> ContainerRegistryBuilder
fn default() -> ContainerRegistryBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ContainerRegistryBuilder
impl !RefUnwindSafe for ContainerRegistryBuilder
impl Send for ContainerRegistryBuilder
impl Sync for ContainerRegistryBuilder
impl Unpin for ContainerRegistryBuilder
impl !UnwindSafe for ContainerRegistryBuilder
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
Mutably borrows from an owned value. Read more