[−][src]Struct dropshot::ConfigDropshot
Configuration for a Dropshot server.
This type implements serde::Deserialize
and serde::Serialize
and it
can be composed with the consumer's configuration (whatever format that's
in). For example, consumers could define a custom MyAppConfig
for an app
that contains a Dropshot server:
use dropshot::ConfigDropshot; use serde::Deserialize; #[derive(Deserialize)] struct MyAppConfig { http_api_server: ConfigDropshot, /* ... (other app-specific config) */ } fn main() -> Result<(), String> { let my_config: MyAppConfig = toml::from_str( r##" [http_api_server] bind_address = "127.0.0.1:12345" # ... (other app-specific config) "## ).map_err(|error| format!("parsing config: {}", error))?; let dropshot_config: &ConfigDropshot = &my_config.http_api_server; /* ... (use the config to create a server) */ Ok(()) }
Fields
bind_address: SocketAddr
IP address and TCP port to which to bind for accepting connections
Trait Implementations
impl Clone for ConfigDropshot
[src]
fn clone(&self) -> ConfigDropshot
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ConfigDropshot
[src]
impl<'de> Deserialize<'de> for ConfigDropshot
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialEq<ConfigDropshot> for ConfigDropshot
[src]
fn eq(&self, other: &ConfigDropshot) -> bool
[src]
fn ne(&self, other: &ConfigDropshot) -> bool
[src]
impl Serialize for ConfigDropshot
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for ConfigDropshot
[src]
Auto Trait Implementations
impl RefUnwindSafe for ConfigDropshot
impl Send for ConfigDropshot
impl Sync for ConfigDropshot
impl Unpin for ConfigDropshot
impl UnwindSafe for ConfigDropshot
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
[src]
T: Send + Sync + UnwindSafe + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,