pub struct AccessControlBuilder { /* private fields */ }
Expand description
Convenience builder pattern
Implementations§
source§impl AccessControlBuilder
impl AccessControlBuilder
sourcepub fn new() -> AccessControlBuilder
pub fn new() -> AccessControlBuilder
Create a new builder for AccessControl
.
sourcepub fn allow_all_hosts(self) -> AccessControlBuilder
pub fn allow_all_hosts(self) -> AccessControlBuilder
Allow all hosts.
sourcepub fn allow_all_origins(self) -> AccessControlBuilder
pub fn allow_all_origins(self) -> AccessControlBuilder
Allow all origins.
sourcepub fn allow_all_headers(self) -> AccessControlBuilder
pub fn allow_all_headers(self) -> AccessControlBuilder
Allow all headers.
sourcepub fn set_allowed_hosts<List, H>(
self,
list: List
) -> Result<AccessControlBuilder, Error>where
List: IntoIterator<Item = H>,
H: Into<String>,
pub fn set_allowed_hosts<List, H>(
self,
list: List
) -> Result<AccessControlBuilder, Error>where
List: IntoIterator<Item = H>,
H: Into<String>,
Configure allowed hosts.
Default - allow all.
sourcepub fn set_allowed_origins<Origin, List>(
self,
list: List
) -> Result<AccessControlBuilder, Error>where
List: IntoIterator<Item = Origin>,
Origin: Into<String>,
pub fn set_allowed_origins<Origin, List>(
self,
list: List
) -> Result<AccessControlBuilder, Error>where
List: IntoIterator<Item = Origin>,
Origin: Into<String>,
Configure allowed origins.
Default - allow all.
sourcepub fn set_allowed_headers<Header, List>(
self,
list: List
) -> Result<AccessControlBuilder, Error>where
List: IntoIterator<Item = Header>,
Header: Into<String>,
pub fn set_allowed_headers<Header, List>(
self,
list: List
) -> Result<AccessControlBuilder, Error>where
List: IntoIterator<Item = Header>,
Header: Into<String>,
Configure allowed CORS headers.
Default - allow all.
sourcepub fn build(self) -> AccessControl
pub fn build(self) -> AccessControl
Finalize the AccessControl
settings.
Trait Implementations§
source§impl Debug for AccessControlBuilder
impl Debug for AccessControlBuilder
source§impl Default for AccessControlBuilder
impl Default for AccessControlBuilder
source§fn default() -> AccessControlBuilder
fn default() -> AccessControlBuilder
Returns the “default value” for a type. Read more