Enum script::dom::bindings::conversions::ConversionResult
source · pub enum ConversionResult<T> {
Success(T),
Failure(Cow<'static, str>),
}
Expand description
An enum to better support enums through FromJSValConvertible::from_jsval.
Variants§
Success(T)
Everything went fine.
Failure(Cow<'static, str>)
Conversion failed, without a pending exception.
Implementations§
source§impl<T> ConversionResult<T>
impl<T> ConversionResult<T>
sourcepub fn get_success_value(&self) -> Option<&T>
pub fn get_success_value(&self) -> Option<&T>
Returns Some(value) if it is ConversionResult::Success
.
Trait Implementations§
source§impl<T> Clone for ConversionResult<T>where
T: Clone,
impl<T> Clone for ConversionResult<T>where T: Clone,
source§fn clone(&self) -> ConversionResult<T>
fn clone(&self) -> ConversionResult<T>
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<T> Debug for ConversionResult<T>where
T: Debug,
impl<T> Debug for ConversionResult<T>where T: Debug,
source§impl<T> PartialEq<ConversionResult<T>> for ConversionResult<T>where
T: PartialEq<T>,
impl<T> PartialEq<ConversionResult<T>> for ConversionResult<T>where T: PartialEq<T>,
source§fn eq(&self, other: &ConversionResult<T>) -> bool
fn eq(&self, other: &ConversionResult<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<T> Eq for ConversionResult<T>where T: Eq,
impl<T> StructuralEq for ConversionResult<T>
impl<T> StructuralPartialEq for ConversionResult<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for ConversionResult<T>where T: RefUnwindSafe,
impl<T> Send for ConversionResult<T>where T: Send,
impl<T> Sync for ConversionResult<T>where T: Sync,
impl<T> Unpin for ConversionResult<T>where T: Unpin,
impl<T> UnwindSafe for ConversionResult<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<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,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<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,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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> MaybeBoxed<Box<T, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
source§fn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert