Struct bonsaidb::server::BonsaiListenConfig
source · pub struct BonsaiListenConfig {
pub address: SocketAddr,
pub reuse_address: bool,
}
Expand description
Configuration for the BonsaiDb network protocol.
The BonsaiDb network protocol is built using QUIC, which uses UDP instead of TCP.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.address: SocketAddr
The socket port to listen for connections on.
By default, this is [::]:5645
.
reuse_address: bool
If this is set to true, the SO_REUSEADDR
flag will be set on the
listening socket.
This informs the operating system that it should allow reusing the exact same address/port combination in the future, which enables restarting a BonsaiDb network protocol listener without restarting the process itself. In general, this is not needed for users in regular deployments, and is more useful for specific kinds of testing.
Implementations§
source§impl BonsaiListenConfig
impl BonsaiListenConfig
sourcepub fn port(self, port: u16) -> BonsaiListenConfig
pub fn port(self, port: u16) -> BonsaiListenConfig
Sets the port for the socket address, and returns the updated config.
sourcepub const fn reuse_address(self, reuse_address: bool) -> BonsaiListenConfig
pub const fn reuse_address(self, reuse_address: bool) -> BonsaiListenConfig
Sets the reuse_address
flag.
Trait Implementations§
source§impl Clone for BonsaiListenConfig
impl Clone for BonsaiListenConfig
source§fn clone(&self) -> BonsaiListenConfig
fn clone(&self) -> BonsaiListenConfig
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for BonsaiListenConfig
impl Debug for BonsaiListenConfig
source§impl Default for BonsaiListenConfig
impl Default for BonsaiListenConfig
source§fn default() -> BonsaiListenConfig
fn default() -> BonsaiListenConfig
Returns the “default value” for a type. Read more
source§impl From<u16> for BonsaiListenConfig
impl From<u16> for BonsaiListenConfig
source§fn from(value: u16) -> BonsaiListenConfig
fn from(value: u16) -> BonsaiListenConfig
Converts to this type from the input type.
impl Copy for BonsaiListenConfig
Auto Trait Implementations§
impl RefUnwindSafe for BonsaiListenConfig
impl Send for BonsaiListenConfig
impl Sync for BonsaiListenConfig
impl Unpin for BonsaiListenConfig
impl UnwindSafe for BonsaiListenConfig
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