#[non_exhaustive]pub struct Cors {
pub origin: Vec<String>,
pub method: Vec<String>,
pub response_header: Vec<String>,
pub max_age_seconds: i32,
/* private fields */
}Expand description
Cross-Origin Response sharing (CORS) properties for a bucket. For more on Cloud Storage and CORS, see https://cloud.google.com/storage/docs/cross-origin. For more on CORS in general, see https://tools.ietf.org/html/rfc6454.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.origin: Vec<String>Optional. The list of origins eligible to receive CORS response headers.
For more information about origins, see RFC
6454. Note: * is permitted in the
list of origins, and means any origin.
method: Vec<String>Optional. The list of HTTP methods on which to include CORS response
headers,
(GET, OPTIONS, POST, etc) Note: * is permitted in the list of
methods, and means “any method”.
response_header: Vec<String>Optional. The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.
max_age_seconds: i32Optional. The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.
Implementations§
Source§impl Cors
impl Cors
pub fn new() -> Self
Sourcepub fn set_origin<T, V>(self, v: T) -> Self
pub fn set_origin<T, V>(self, v: T) -> Self
Sourcepub fn set_method<T, V>(self, v: T) -> Self
pub fn set_method<T, V>(self, v: T) -> Self
Sourcepub fn set_response_header<T, V>(self, v: T) -> Self
pub fn set_response_header<T, V>(self, v: T) -> Self
Sets the value of response_header.
§Example
let x = Cors::new().set_response_header(["a", "b", "c"]);Sourcepub fn set_max_age_seconds<T: Into<i32>>(self, v: T) -> Self
pub fn set_max_age_seconds<T: Into<i32>>(self, v: T) -> Self
Trait Implementations§
impl StructuralPartialEq for Cors
Auto Trait Implementations§
impl Freeze for Cors
impl RefUnwindSafe for Cors
impl Send for Cors
impl Sync for Cors
impl Unpin for Cors
impl UnwindSafe for Cors
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
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> 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