pub struct Serve<B: Backend> {
pub listen_on: Option<u16>,
pub http_port: Option<SocketAddr>,
pub https_port: Option<SocketAddr>,
/* private fields */
}Expand description
Execute the server
Fields
listen_on: Option<u16>The UDP port for the BonsaiDb protocol. Defaults to UDP port 5645 (not an officially registered port).
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
sourceimpl<B: Backend> Serve<B>
impl<B: Backend> Serve<B>
sourcepub async fn execute_with<S: TcpService>(
&self,
server: &CustomServer<B>,
service: S
) -> Result<(), Error>
pub async fn execute_with<S: TcpService>(
&self,
server: &CustomServer<B>,
service: S
) -> Result<(), Error>
Starts the server using service for websocket connections, if enabled.
Trait Implementations
sourceimpl<B: Backend> FromArgMatches for Serve<B>
impl<B: Backend> FromArgMatches for Serve<B>
sourcefn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
sourcefn 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.
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more