Struct cargo_test_support::registry::RegistryBuilder
source · pub struct RegistryBuilder { /* private fields */ }
Expand description
A builder for initializing registries.
Implementations§
source§impl RegistryBuilder
impl RegistryBuilder
pub fn new() -> RegistryBuilder
sourcepub fn add_responder<R: 'static + Send + Fn(&Request, &HttpServer) -> Response>(
self,
url: impl Into<String>,
responder: R,
) -> Self
pub fn add_responder<R: 'static + Send + Fn(&Request, &HttpServer) -> Response>( self, url: impl Into<String>, responder: R, ) -> Self
Adds a custom HTTP response for a specific url
pub fn not_found_handler<R: 'static + Send + Fn(&Request, &HttpServer) -> Response>( self, responder: R, ) -> Self
sourcepub fn delayed_index_update(self, delay: usize) -> Self
pub fn delayed_index_update(self, delay: usize) -> Self
Configures the git index update to be delayed by the given number of seconds.
sourcepub fn alternative_named(self, alt: &str) -> Self
pub fn alternative_named(self, alt: &str) -> Self
Sets whether or not to initialize as an alternative registry.
sourcepub fn alternative(self) -> Self
pub fn alternative(self) -> Self
Sets whether or not to initialize as an alternative registry.
sourcepub fn no_configure_token(self) -> Self
pub fn no_configure_token(self) -> Self
Prevents placing a token in the configuration
sourcepub fn no_configure_registry(self) -> Self
pub fn no_configure_registry(self) -> Self
Prevents adding the registry to the configuration.
sourcepub fn auth_required(self) -> Self
pub fn auth_required(self) -> Self
Sets this registry to require the authentication token for all operations.
sourcepub fn http_index(self) -> Self
pub fn http_index(self) -> Self
Operate the index over http
sourcepub fn credential_provider(self, provider: &[&str]) -> Self
pub fn credential_provider(self, provider: &[&str]) -> Self
The credential provider to configure for this registry.
sourcepub fn build(self) -> TestRegistry
pub fn build(self) -> TestRegistry
Initializes the registry.
Auto Trait Implementations§
impl Freeze for RegistryBuilder
impl !RefUnwindSafe for RegistryBuilder
impl Send for RegistryBuilder
impl !Sync for RegistryBuilder
impl Unpin for RegistryBuilder
impl !UnwindSafe for RegistryBuilder
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
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 more