pub struct TestTypesense { /* private fields */ }Expand description
A struct holding TypesenseContainer and providing convenience
methods for interacting with Typesense in integration tests.
Implementations§
Source§impl TestTypesense
impl TestTypesense
Sourcepub async fn new<L: ContainerLogConsumer>(
config: ContainerConfig<L>,
) -> Result<Self>
pub async fn new<L: ContainerLogConsumer>( config: ContainerConfig<L>, ) -> Result<Self>
Starts a Typesense container for integration tests, with the given config for integration tests.
§Errors
Returns anyhow::Error if we can’t start the Typesense container.
Sourcepub async fn make_client_config(&self) -> Result<SearchClientConfig>
pub async fn make_client_config(&self) -> Result<SearchClientConfig>
Makes a SearchClientConfig for the given Typesense container.
§Errors
Returns anyhow::Error if we can’t get the URL for Typesense.
Sourcepub async fn new_client(&self) -> Result<SearchClient>
pub async fn new_client(&self) -> Result<SearchClient>
Creates a new SearchClient configured for this Typesense instance.
§Errors
Returns anyhow::Result if we can’t:
- Get the config for the client to connect to Typesense
- Initialize the search client with the config we got
Sourcepub fn container(&self) -> &TypesenseContainer
pub fn container(&self) -> &TypesenseContainer
Returns a reference to the underlying Typesense container.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TestTypesense
impl !UnwindSafe for TestTypesense
impl Freeze for TestTypesense
impl Send for TestTypesense
impl Sync for TestTypesense
impl Unpin for TestTypesense
impl UnsafeUnpin for TestTypesense
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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>
Wrap the input message
T in a tonic::Request