pub struct TestingContainerRegistry {
pub registry: Arc<ContainerRegistry>,
pub temp_storage: Option<TempDir>,
pub body_limit: usize,
pub bind_addr: SocketAddr,
}
Expand description
A context of a container registry instantiated for testing.
Fields§
§registry: Arc<ContainerRegistry>
Reference to the registry instance.
temp_storage: Option<TempDir>
Storage used by the registry.
body_limit: usize
The body limit to set when running standalone.
bind_addr: SocketAddr
The address to bind to.
Implementations§
Source§impl TestingContainerRegistry
impl TestingContainerRegistry
Sourcepub fn make_service(&self) -> RouterIntoService<Body>
pub fn make_service(&self) -> RouterIntoService<Body>
Creates an axum
service for the registry.
Sourcepub fn bind(&mut self, addr: SocketAddr) -> &mut Self
pub fn bind(&mut self, addr: SocketAddr) -> &mut Self
Address to bind to.
Sourcepub fn body_limit(&mut self, body_limit: usize) -> &mut Self
pub fn body_limit(&mut self, body_limit: usize) -> &mut Self
Sets the body limit, in bytes.
Sourcepub fn run_in_background(self) -> RunningRegistry
pub fn run_in_background(self) -> RunningRegistry
Runs a registry in a seperate thread in the background.
Returns a handle to the registry running in the background. If dropped, the registry will be shutdown and its storage cleaned up.
Sourcepub fn registry(&self) -> &ContainerRegistry
pub fn registry(&self) -> &ContainerRegistry
Grants access to the registry.
Auto Trait Implementations§
impl Freeze for TestingContainerRegistry
impl !RefUnwindSafe for TestingContainerRegistry
impl Send for TestingContainerRegistry
impl Sync for TestingContainerRegistry
impl Unpin for TestingContainerRegistry
impl !UnwindSafe for TestingContainerRegistry
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