pub struct ContainerBuilder { /* private fields */ }Expand description
Builder for the Container.
You should not use this directly, but use the Container::builder method instead.
By default this container is the same as running this:
let builder = Container::builder()
.with_image_tag("latest")
.with_port(3000)
.with_api_token("secret");Implementations§
Source§impl ContainerBuilder
impl ContainerBuilder
Sourcepub fn with_image_tag(self, tag: &str) -> Self
pub fn with_image_tag(self, tag: &str) -> Self
Set the image tag to use for the container.
Sourcepub fn with_api_token(self, token: &str) -> Self
pub fn with_api_token(self, token: &str) -> Self
Set the API token to use for the container.
Sourcepub fn with_port(self, port: impl Into<ContainerPort>) -> Self
pub fn with_port(self, port: impl Into<ContainerPort>) -> Self
Set the port to use for the container.
This is the port that will be exposed from the container to the host.
It will be mapped to a random port on the host that you can connect to.
To find that port, use the Container::get_mapped_port method.
Sourcepub fn with_signing_key(self) -> Self
pub fn with_signing_key(self) -> Self
Enable signing of events with a generated key pair.
This will generate a new key pair for signing events and configure the database to use it. The private key will be used to sign events and the public key will be used to verify them.
Sourcepub async fn start(self) -> Result<Container, ContainerError>
pub async fn start(self) -> Result<Container, ContainerError>
Start the test container.
This call will transform the builder into a running container. It takes care of starting the container and waiting for it to be ready by waiting for the ping endpoint to respond since that doesn’t require authentication.
§Errors
This function will return an error if the container could not be started.
Trait Implementations§
Source§impl Clone for ContainerBuilder
impl Clone for ContainerBuilder
Source§fn clone(&self) -> ContainerBuilder
fn clone(&self) -> ContainerBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContainerBuilder
impl Debug for ContainerBuilder
Auto Trait Implementations§
impl Freeze for ContainerBuilder
impl RefUnwindSafe for ContainerBuilder
impl Send for ContainerBuilder
impl Sync for ContainerBuilder
impl Unpin for ContainerBuilder
impl UnsafeUnpin for ContainerBuilder
impl UnwindSafe for ContainerBuilder
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request