Enum rocket_cors::AllOrSome
source · pub enum AllOrSome<T> {
All,
Some(T),
}
Expand description
An enum signifying that some of type T is allowed, or All
(everything is allowed).
Default
is implemented for this enum and is All
.
This enum is serialized and deserialized “Externally tagged”
Variants
All
Everything is allowed. Usually equivalent to the “*” value.
Some(T)
Only some of T
is allowed
Implementations
sourceimpl AllOrSome<HashSet<Url>>
impl AllOrSome<HashSet<Url>>
sourcepub fn new_from_str_list(urls: &[&str]) -> (Self, HashMap<String, ParseError>)
👎Deprecated since 0.1.3: please use AllowedOrigins::Some
instead
pub fn new_from_str_list(urls: &[&str]) -> (Self, HashMap<String, ParseError>)
AllowedOrigins::Some
insteadNew AllOrSome
from a list of URL strings.
Returns a tuple where the first element is the struct AllOrSome
,
and the second element
is a map of strings which failed to parse into URLs and their associated parse errors.
sourceimpl AllOrSome<HashSet<Url, RandomState>>
impl AllOrSome<HashSet<Url, RandomState>>
Trait Implementations
sourceimpl<'de, T> Deserialize<'de> for AllOrSome<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for AllOrSome<T>where
T: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<T: PartialEq> PartialEq<AllOrSome<T>> for AllOrSome<T>
impl<T: PartialEq> PartialEq<AllOrSome<T>> for AllOrSome<T>
impl<T: Eq> Eq for AllOrSome<T>
impl<T> StructuralEq for AllOrSome<T>
impl<T> StructuralPartialEq for AllOrSome<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for AllOrSome<T>where
T: RefUnwindSafe,
impl<T> Send for AllOrSome<T>where
T: Send,
impl<T> Sync for AllOrSome<T>where
T: Sync,
impl<T> Unpin for AllOrSome<T>where
T: Unpin,
impl<T> UnwindSafe for AllOrSome<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
Converts
self
into a collection.