pub enum Data<R, C> {
Real(R),
Complex(C),
}
Expand description
Data saved by an Analysis
.
Variants§
Implementations§
source§impl<R, C> Data<R, C>
impl<R, C> Data<R, C>
sourcepub fn unwrap_real(self) -> R
pub fn unwrap_real(self) -> R
Returns the value contained in this variant.
§Panics
Panics if the enum value is not of the expected variant.
sourcepub fn get_real(&self) -> Option<&R>
pub fn get_real(&self) -> Option<&R>
Returns a reference to the value contained in this variant.
Returns None
if the enum value is not of the expected variant.
sourcepub fn into_real(self) -> Option<R>
pub fn into_real(self) -> Option<R>
Returns the value contained in this variant.
Returns None
if the enum value is not of the expected variant.
sourcepub fn unwrap_complex(self) -> C
pub fn unwrap_complex(self) -> C
Returns the value contained in this variant.
§Panics
Panics if the enum value is not of the expected variant.
sourcepub fn get_complex(&self) -> Option<&C>
pub fn get_complex(&self) -> Option<&C>
Returns a reference to the value contained in this variant.
Returns None
if the enum value is not of the expected variant.
sourcepub fn into_complex(self) -> Option<C>
pub fn into_complex(self) -> Option<C>
Returns the value contained in this variant.
Returns None
if the enum value is not of the expected variant.
sourcepub fn is_complex(&self) -> bool
pub fn is_complex(&self) -> bool
Returns true if this value is the expected variant.
Trait Implementations§
source§impl<'de, R, C> Deserialize<'de> for Data<R, C>where
R: Deserialize<'de>,
C: Deserialize<'de>,
impl<'de, R, C> Deserialize<'de> for Data<R, C>where
R: Deserialize<'de>,
C: Deserialize<'de>,
source§fn 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
source§impl<R: PartialEq, C: PartialEq> PartialEq for Data<R, C>
impl<R: PartialEq, C: PartialEq> PartialEq for Data<R, C>
impl<R, C> StructuralPartialEq for Data<R, C>
Auto Trait Implementations§
impl<R, C> RefUnwindSafe for Data<R, C>where
C: RefUnwindSafe,
R: RefUnwindSafe,
impl<R, C> Send for Data<R, C>
impl<R, C> Sync for Data<R, C>
impl<R, C> Unpin for Data<R, C>
impl<R, C> UnwindSafe for Data<R, C>where
C: UnwindSafe,
R: UnwindSafe,
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