pub struct HttpConfig {
pub host: String,
pub port: u16,
pub allowed_origins: Vec<String>,
pub allowed_hosts: Vec<String>,
}Expand description
HTTP transport binding and security settings.
Fields§
§host: StringBind host for HTTP transport.
port: u16Bind port for HTTP transport.
allowed_origins: Vec<String>Allowed CORS origins.
allowed_hosts: Vec<String>Allowed host names.
Implementations§
Source§impl HttpConfig
impl HttpConfig
Sourcepub const DEFAULT_HOST: &'static str = "127.0.0.1"
pub const DEFAULT_HOST: &'static str = "127.0.0.1"
Default HTTP bind host.
Sourcepub const DEFAULT_PORT: u16 = 9001
pub const DEFAULT_PORT: u16 = 9001
Default HTTP bind port.
Sourcepub fn default_allowed_origins() -> Vec<String>
pub fn default_allowed_origins() -> Vec<String>
Return default allowed CORS origins.
Sourcepub fn default_allowed_hosts() -> Vec<String>
pub fn default_allowed_hosts() -> Vec<String>
Returns default allowed host names.
Trait Implementations§
Source§impl Clone for HttpConfig
impl Clone for HttpConfig
Source§fn clone(&self) -> HttpConfig
fn clone(&self) -> HttpConfig
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for HttpConfig
impl RefUnwindSafe for HttpConfig
impl Send for HttpConfig
impl Sync for HttpConfig
impl Unpin for HttpConfig
impl UnsafeUnpin for HttpConfig
impl UnwindSafe for HttpConfig
Blanket Implementations§
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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