pub struct ServedRepositoryBuilder { /* private fields */ }Expand description
A builder to construct a test repository server.
Implementations§
Source§impl ServedRepositoryBuilder
impl ServedRepositoryBuilder
Sourcepub fn response_overrider(self, responder: impl HttpResponder) -> Self
pub fn response_overrider(self, responder: impl HttpResponder) -> Self
Override how the ServedRepositoryBuilder responds to requests.
Requests are passed through responders in the order in which the responders are added to this builder.
Sourcepub fn use_https_domain(self, domain: Domain) -> Self
pub fn use_https_domain(self, domain: Domain) -> Self
Serve the repository over https via a domain known by test certificates and keys.
Sourcepub fn bind_to_addr(self, addr: impl Into<IpAddr>) -> Self
pub fn bind_to_addr(self, addr: impl Into<IpAddr>) -> Self
Bind the tcp listener to the provided ip address. Binds to Ipv6Addr::UNSPECIFIED by default.
Sourcepub fn bind_to_port(self, port: u16) -> Self
pub fn bind_to_port(self, port: u16) -> Self
Bind the tcp listener to the provided port. Binds to 0 (allowing system to select a port) by default.
Sourcepub fn start(self) -> Result<ServedRepository, Error>
pub fn start(self) -> Result<ServedRepository, Error>
Spawn the server on the current executor, returning a handle to manage the server.
Auto Trait Implementations§
impl Freeze for ServedRepositoryBuilder
impl !RefUnwindSafe for ServedRepositoryBuilder
impl Send for ServedRepositoryBuilder
impl Sync for ServedRepositoryBuilder
impl Unpin for ServedRepositoryBuilder
impl !UnwindSafe for ServedRepositoryBuilder
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, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to [Self]§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoAny for T
impl<T> IntoAny for T
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Tries to perform the conversion.