Struct tower_http::cors::AllowPrivateNetwork
source · pub struct AllowPrivateNetwork(/* private fields */);
Expand description
Holds configuration for how to set the Access-Control-Allow-Private-Network
header.
See CorsLayer::allow_private_network
for more details.
Implementations§
source§impl AllowPrivateNetwork
impl AllowPrivateNetwork
sourcepub fn yes() -> Self
pub fn yes() -> Self
Allow requests via a more private network than the one used to access the origin
See CorsLayer::allow_private_network
for more details.
sourcepub fn predicate<F>(f: F) -> Self
pub fn predicate<F>(f: F) -> Self
Allow requests via private network for some requests, based on a given predicate
The first argument to the predicate is the request origin.
See CorsLayer::allow_private_network
for more details.
Trait Implementations§
source§impl Clone for AllowPrivateNetwork
impl Clone for AllowPrivateNetwork
source§fn clone(&self) -> AllowPrivateNetwork
fn clone(&self) -> AllowPrivateNetwork
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 AllowPrivateNetwork
impl Debug for AllowPrivateNetwork
source§impl Default for AllowPrivateNetwork
impl Default for AllowPrivateNetwork
source§fn default() -> AllowPrivateNetwork
fn default() -> AllowPrivateNetwork
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AllowPrivateNetwork
impl !RefUnwindSafe for AllowPrivateNetwork
impl Send for AllowPrivateNetwork
impl Sync for AllowPrivateNetwork
impl Unpin for AllowPrivateNetwork
impl !UnwindSafe for AllowPrivateNetwork
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)