pub struct Serve<B: Backend> {
pub listen_on: Option<SocketAddr>,
pub reuse_address: Option<bool>,
pub http_port: Option<SocketAddr>,
pub https_port: Option<SocketAddr>,
/* private fields */
}Expand description
Execute the server
Fields§
§listen_on: Option<SocketAddr>The socket address to listen for the BonsaiDb protocol. Defaults to a localhost IP address for UDP port 5645 (not an officially registered port).
reuse_address: Option<bool>If this option is specified, the SO_REUSEADDR flag will be set on the
underlying socket. See BonsaiListenConfig::reuse_address for more
information.
http_port: Option<SocketAddr>The bind port and address for HTTP traffic. Defaults to TCP port 80.
https_port: Option<SocketAddr>The bind port and address for HTTPS traffic. Defaults to TCP port 443.
Implementations§
Source§impl<B: Backend> Serve<B>
impl<B: Backend> Serve<B>
Sourcepub async fn execute(
&self,
server: &CustomServer<B>,
) -> Result<(), BackendError<B::Error>>
pub async fn execute( &self, server: &CustomServer<B>, ) -> Result<(), BackendError<B::Error>>
Starts the server.
Sourcepub async fn execute_with<S: TcpService>(
&self,
server: &CustomServer<B>,
service: S,
) -> Result<(), BackendError<B::Error>>
pub async fn execute_with<S: TcpService>( &self, server: &CustomServer<B>, service: S, ) -> Result<(), BackendError<B::Error>>
Starts the server using service for websocket connections, if enabled.
Trait Implementations§
Source§impl<B: Backend> Args for Serve<B>
impl<B: Backend> Args for Serve<B>
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Append to
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl<B: Backend> FromArgMatches for Serve<B>
impl<B: Backend> FromArgMatches for Serve<B>
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Auto Trait Implementations§
impl<B> Freeze for Serve<B>
impl<B> RefUnwindSafe for Serve<B>where
B: RefUnwindSafe,
impl<B> Send for Serve<B>
impl<B> Sync for Serve<B>
impl<B> Unpin for Serve<B>where
B: Unpin,
impl<B> UnwindSafe for Serve<B>where
B: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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