[−][src]Enum insta::internals::Content
Represents variable typed content.
This is used internally for the serialization system to represent values before the actual snapshots are written.
Variants
Bool(bool)
U8(u8)
U16(u16)
U32(u32)
U64(u64)
I8(i8)
I16(i16)
I32(i32)
I64(i64)
F32(f32)
F64(f64)
Char(char)
String(String)
Bytes(Vec<u8>)
Seq(Vec<Content>)
Map(Vec<(Content, Content)>)
Methods
impl Content
[src]
pub fn as_str(&self) -> Option<&str>
[src]
Returns the value as string
pub fn as_u64(&self) -> Option<u64>
[src]
Returns the value as u64
pub fn walk<F: FnMut(&mut Content) -> bool>(&mut self, visit: F)
[src]
Recursively walks the content structure mutably.
The callback is invoked for every content in the tree.
Trait Implementations
impl From<bool> for Content
[src]
impl From<u8> for Content
[src]
impl From<u16> for Content
[src]
impl From<u32> for Content
[src]
impl From<u64> for Content
[src]
impl From<i8> for Content
[src]
impl From<i16> for Content
[src]
impl From<i32> for Content
[src]
impl From<i64> for Content
[src]
impl From<f32> for Content
[src]
impl From<f64> for Content
[src]
impl From<char> for Content
[src]
impl From<String> for Content
[src]
impl From<Vec<u8>> for Content
[src]
impl From<()> for Content
[src]
impl<'a> From<&'a str> for Content
[src]
impl<'a> From<&'a [u8]> for Content
[src]
impl Clone for Content
[src]
fn clone(&self) -> Content
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Content
[src]
impl Serialize for Content
[src]
Auto Trait Implementations
impl Unpin for Content
impl Send for Content
impl Sync for Content
impl UnwindSafe for Content
impl RefUnwindSafe for Content
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,