Struct google_api_proto::google::cloud::compute::v1::CorsPolicy
source · pub struct CorsPolicy {
pub allow_credentials: Option<bool>,
pub allow_headers: Vec<String>,
pub allow_methods: Vec<String>,
pub allow_origin_regexes: Vec<String>,
pub allow_origins: Vec<String>,
pub disabled: Option<bool>,
pub expose_headers: Vec<String>,
pub max_age: Option<i32>,
}
Expand description
The specification for allowing client-side cross-origin requests. For more information about the W3C recommendation for cross-origin resource sharing (CORS), see Fetch API Living Standard.
Fields§
§allow_credentials: Option<bool>
In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This field translates to the Access-Control-Allow-Credentials header. Default is false.
allow_headers: Vec<String>
Specifies the content for the Access-Control-Allow-Headers header.
allow_methods: Vec<String>
Specifies the content for the Access-Control-Allow-Methods header.
allow_origin_regexes: Vec<String>
Specifies a regular expression that matches allowed origins. For more information, see regular expression syntax . An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED.
allow_origins: Vec<String>
Specifies the list of origins that is allowed to do CORS requests. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
disabled: Option<bool>
If true, disables the CORS policy. The default value is false, which indicates that the CORS policy is in effect.
expose_headers: Vec<String>
Specifies the content for the Access-Control-Expose-Headers header.
max_age: Option<i32>
Specifies how long results of a preflight request can be cached in seconds. This field translates to the Access-Control-Max-Age header.
Implementations§
source§impl CorsPolicy
impl CorsPolicy
sourcepub fn disabled(&self) -> bool
pub fn disabled(&self) -> bool
Returns the value of disabled
, or the default value if disabled
is unset.
sourcepub fn max_age(&self) -> i32
pub fn max_age(&self) -> i32
Returns the value of max_age
, or the default value if max_age
is unset.
sourcepub fn allow_credentials(&self) -> bool
pub fn allow_credentials(&self) -> bool
Returns the value of allow_credentials
, or the default value if allow_credentials
is unset.
Trait Implementations§
source§impl Clone for CorsPolicy
impl Clone for CorsPolicy
source§fn clone(&self) -> CorsPolicy
fn clone(&self) -> CorsPolicy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CorsPolicy
impl Debug for CorsPolicy
source§impl Default for CorsPolicy
impl Default for CorsPolicy
source§impl Message for CorsPolicy
impl Message for CorsPolicy
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for CorsPolicy
impl PartialEq for CorsPolicy
source§fn eq(&self, other: &CorsPolicy) -> bool
fn eq(&self, other: &CorsPolicy) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for CorsPolicy
Auto Trait Implementations§
impl Freeze for CorsPolicy
impl RefUnwindSafe for CorsPolicy
impl Send for CorsPolicy
impl Sync for CorsPolicy
impl Unpin for CorsPolicy
impl UnwindSafe for CorsPolicy
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request