[go: up one dir, main page]

Value

Trait Value 

Source
pub trait Value {
Show 17 methods // Required method fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result; // Provided methods fn tag(&self) -> Option<Tag> { ... } fn to_bool(&self) -> Option<bool> { ... } fn to_f32(&self) -> Option<f32> { ... } fn to_f64(&self) -> Option<f64> { ... } fn to_i8(&self) -> Option<i8> { ... } fn to_i16(&self) -> Option<i16> { ... } fn to_i32(&self) -> Option<i32> { ... } fn to_i64(&self) -> Option<i64> { ... } fn to_i128(&self) -> Option<i128> { ... } fn to_u8(&self) -> Option<u8> { ... } fn to_u16(&self) -> Option<u16> { ... } fn to_u32(&self) -> Option<u32> { ... } fn to_u64(&self) -> Option<u64> { ... } fn to_u128(&self) -> Option<u128> { ... } fn to_text(&self) -> Option<&str> { ... } fn to_binary(&self) -> Option<&[u8]> { ... }
}
Expand description

A producer of structured data.

Each call to Value::stream is expected to produce a single complete value.

Required Methods§

Source

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Stream this value through a Stream.

Provided Methods§

Source

fn tag(&self) -> Option<Tag>

Get the tag of this value, if there is one.

Source

fn to_bool(&self) -> Option<bool>

Try convert this value into a boolean.

Source

fn to_f32(&self) -> Option<f32>

Try convert this value into a 32bit binary floating point number.

Source

fn to_f64(&self) -> Option<f64>

Try convert this value into a 64bit binary floating point number.

Source

fn to_i8(&self) -> Option<i8>

Try convert this value into a signed 8bit integer.

Source

fn to_i16(&self) -> Option<i16>

Try convert this value into a signed 16bit integer.

Source

fn to_i32(&self) -> Option<i32>

Try convert this value into a signed 32bit integer.

Source

fn to_i64(&self) -> Option<i64>

Try convert this value into a signed 64bit integer.

Source

fn to_i128(&self) -> Option<i128>

Try convert this value into a signed 128bit integer.

Source

fn to_u8(&self) -> Option<u8>

Try convert this value into an unsigned 8bit integer.

Source

fn to_u16(&self) -> Option<u16>

Try convert this value into an unsigned 16bit integer.

Source

fn to_u32(&self) -> Option<u32>

Try convert this value into an unsigned 32bit integer.

Source

fn to_u64(&self) -> Option<u64>

Try convert this value into an unsigned 64bit integer.

Source

fn to_u128(&self) -> Option<u128>

Try convert this value into an unsigned 128bit integer.

Source

fn to_text(&self) -> Option<&str>

Try convert this value into a text string.

Source

fn to_binary(&self) -> Option<&[u8]>

Try convert this value into a bitstring.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Value for bool

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

fn tag(&self) -> Option<Tag>

Source§

fn to_bool(&self) -> Option<bool>

Source§

impl Value for char

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

impl Value for f32

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

fn to_f32(&self) -> Option<f32>

Source§

impl Value for f64

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

fn to_f64(&self) -> Option<f64>

Source§

impl Value for i8

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

fn to_i8(&self) -> Option<i8>

Source§

impl Value for i16

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

fn to_i16(&self) -> Option<i16>

Source§

impl Value for i32

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

fn to_i32(&self) -> Option<i32>

Source§

impl Value for i64

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

fn to_i64(&self) -> Option<i64>

Source§

impl Value for i128

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

fn to_i128(&self) -> Option<i128>

Source§

impl Value for str

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

fn tag(&self) -> Option<Tag>

Source§

fn to_text(&self) -> Option<&str>

Source§

impl Value for u8

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

fn to_u8(&self) -> Option<u8>

Source§

impl Value for u16

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

fn to_u16(&self) -> Option<u16>

Source§

impl Value for u32

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

fn to_u32(&self) -> Option<u32>

Source§

impl Value for u64

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

fn to_u64(&self) -> Option<u64>

Source§

impl Value for u128

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

fn to_u128(&self) -> Option<u128>

Source§

impl Value for ()

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

impl Value for String

Source§

fn stream<'a, S: Stream<'a> + ?Sized>(&'a self, stream: &mut S) -> Result

Source§

fn tag(&self) -> Option<Tag>

Source§

fn to_text(&self) -> Option<&str>

Source§

impl<'a, T: Value + ?Sized> Value for &'a T

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

fn tag(&self) -> Option<Tag>

Source§

fn to_bool(&self) -> Option<bool>

Source§

fn to_f32(&self) -> Option<f32>

Source§

fn to_f64(&self) -> Option<f64>

Source§

fn to_i8(&self) -> Option<i8>

Source§

fn to_i16(&self) -> Option<i16>

Source§

fn to_i32(&self) -> Option<i32>

Source§

fn to_i64(&self) -> Option<i64>

Source§

fn to_i128(&self) -> Option<i128>

Source§

fn to_u8(&self) -> Option<u8>

Source§

fn to_u16(&self) -> Option<u16>

Source§

fn to_u32(&self) -> Option<u32>

Source§

fn to_u64(&self) -> Option<u64>

Source§

fn to_u128(&self) -> Option<u128>

Source§

fn to_text(&self) -> Option<&str>

Source§

fn to_binary(&self) -> Option<&[u8]>

Source§

impl<K: Value, V: Value> Value for BTreeMap<K, V>

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

impl<K: Value, V: Value, H: BuildHasher> Value for HashMap<K, V, H>

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

impl<T0: Value> Value for (T0,)

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

impl<T0: Value, T1: Value> Value for (T0, T1)

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

impl<T0: Value, T1: Value, T2: Value> Value for (T0, T1, T2)

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value> Value for (T0, T1, T2, T3)

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value, T4: Value> Value for (T0, T1, T2, T3, T4)

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value, T4: Value, T5: Value> Value for (T0, T1, T2, T3, T4, T5)

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value, T4: Value, T5: Value, T6: Value> Value for (T0, T1, T2, T3, T4, T5, T6)

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value, T4: Value, T5: Value, T6: Value, T7: Value> Value for (T0, T1, T2, T3, T4, T5, T6, T7)

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value, T4: Value, T5: Value, T6: Value, T7: Value, T8: Value> Value for (T0, T1, T2, T3, T4, T5, T6, T7, T8)

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value, T4: Value, T5: Value, T6: Value, T7: Value, T8: Value, T9: Value> Value for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value, T4: Value, T5: Value, T6: Value, T7: Value, T8: Value, T9: Value, T10: Value> Value for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value, T4: Value, T5: Value, T6: Value, T7: Value, T8: Value, T9: Value, T10: Value, T11: Value> Value for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value, T4: Value, T5: Value, T6: Value, T7: Value, T8: Value, T9: Value, T10: Value, T11: Value, T12: Value> Value for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value, T4: Value, T5: Value, T6: Value, T7: Value, T8: Value, T9: Value, T10: Value, T11: Value, T12: Value, T13: Value> Value for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value, T4: Value, T5: Value, T6: Value, T7: Value, T8: Value, T9: Value, T10: Value, T11: Value, T12: Value, T13: Value, T14: Value> Value for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value, T4: Value, T5: Value, T6: Value, T7: Value, T8: Value, T9: Value, T10: Value, T11: Value, T12: Value, T13: Value, T14: Value, T15: Value> Value for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

impl<T: Value + ?Sized> Value for Box<T>

Source§

fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result

Source§

fn tag(&self) -> Option<Tag>

Source§

fn to_bool(&self) -> Option<bool>

Source§

fn to_f32(&self) -> Option<f32>

Source§

fn to_f64(&self) -> Option<f64>

Source§

fn to_i8(&self) -> Option<i8>

Source§

fn to_i16(&self) -> Option<i16>

Source§

fn to_i32(&self) -> Option<i32>

Source§

fn to_i64(&self) -> Option<i64>

Source§

fn to_i128(&self) -> Option<i128>

Source§

fn to_u8(&self) -> Option<u8>

Source§

fn to_u16(&self) -> Option<u16>

Source§

fn to_u32(&self) -> Option<u32>

Source§

fn to_u64(&self) -> Option<u64>

Source§

fn to_u128(&self) -> Option<u128>

Source§

fn to_text(&self) -> Option<&str>

Source§

fn to_binary(&self) -> Option<&[u8]>

Source§

impl<T: Value> Value for Option<T>

Source§

fn stream<'a, S: Stream<'a> + ?Sized>(&'a self, stream: &mut S) -> Result

Source§

fn to_bool(&self) -> Option<bool>

Source§

fn to_f32(&self) -> Option<f32>

Source§

fn to_f64(&self) -> Option<f64>

Source§

fn to_i8(&self) -> Option<i8>

Source§

fn to_i16(&self) -> Option<i16>

Source§

fn to_i32(&self) -> Option<i32>

Source§

fn to_i64(&self) -> Option<i64>

Source§

fn to_i128(&self) -> Option<i128>

Source§

fn to_u8(&self) -> Option<u8>

Source§

fn to_u16(&self) -> Option<u16>

Source§

fn to_u32(&self) -> Option<u32>

Source§

fn to_u64(&self) -> Option<u64>

Source§

fn to_u128(&self) -> Option<u128>

Source§

fn to_text(&self) -> Option<&str>

Source§

fn to_binary(&self) -> Option<&[u8]>

Source§

impl<T: Value> Value for [T]

Source§

fn stream<'a, S: Stream<'a> + ?Sized>(&'a self, stream: &mut S) -> Result

Source§

impl<T: Value> Value for Vec<T>

Source§

fn stream<'a, S: Stream<'a> + ?Sized>(&'a self, stream: &mut S) -> Result

Source§

impl<T: Value, const N: usize> Value for [T; N]

Source§

fn stream<'a, S: Stream<'a> + ?Sized>(&'a self, stream: &mut S) -> Result

Implementors§

Source§

impl Value for BinarySlice

Source§

impl Value for Null

Source§

impl<K: Value, V: Value> Value for MapSlice<K, V>

Source§

impl<V: Display> Value for Display<V>

Source§

impl<const N: usize> Value for BinaryArray<N>