pub struct Serve<B>where
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> Serve<B>where
B: Backend,
impl<B> Serve<B>where
B: Backend,
sourcepub async fn execute(
&self,
server: &CustomServer<B>
) -> Result<(), BackendError<<B as Backend>::Error>>
pub async fn execute( &self, server: &CustomServer<B> ) -> Result<(), BackendError<<B as Backend>::Error>>
Starts the server.
sourcepub async fn execute_with<S>(
&self,
server: &CustomServer<B>,
service: S
) -> Result<(), BackendError<<B as Backend>::Error>>where
S: TcpService,
pub async fn execute_with<S>(
&self,
server: &CustomServer<B>,
service: S
) -> Result<(), BackendError<<B as Backend>::Error>>where
S: TcpService,
Starts the server using service
for websocket connections, if enabled.
Trait Implementations§
source§impl<B> Args for Serve<B>where
B: Backend,
impl<B> Args for Serve<B>where
B: Backend,
source§fn group_id() -> Option<Id>
fn group_id() -> Option<Id>
Report the [
ArgGroup::id
][crate::ArgGroup::id] for this set of argumentssource§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
source§impl<B> FromArgMatches for Serve<B>where
B: Backend,
impl<B> FromArgMatches for Serve<B>where
B: Backend,
source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Serve<B>, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Serve<B>, Error>
source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches
) -> Result<Serve<B>, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches ) -> Result<Serve<B>, 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> 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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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