Cursor

Struct Cursor 

Source
pub struct Cursor<'r> { /* private fields */ }
Expand description

A Cursor allows conventient navigation in a Value AST. Values can be converted to native Rust types if possible and collections can be traversed using at or get.

Implementations§

Source§

impl<'r> Cursor<'r>

Source

pub fn new(v: &'r Value) -> Cursor<'r>

Source

pub fn at(&self, i: usize) -> Cursor<'r>

Source

pub fn get(&self, k: Key) -> Cursor<'r>

Source

pub fn field(&self, s: &str) -> Cursor<'r>

Source

pub fn value(&self) -> Option<&Value>

Source

pub fn opt(&self) -> Option<Cursor<'r>>

Source

pub fn maybe(&self) -> Option<Cursor<'r>>

Source

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

Source

pub fn bytes(&self) -> Option<&Bytes>

Source

pub fn bytes_plain(&self) -> Option<&Vec<u8>>

Source

pub fn bytes_chunked(&self) -> Option<&LinkedList<Vec<u8>>>

Source

pub fn text(&self) -> Option<&Text>

Source

pub fn text_plain(&self) -> Option<&String>

Source

pub fn text_chunked(&self) -> Option<&LinkedList<String>>

Source

pub fn float32(&self) -> Option<f32>

Source

pub fn float64(&self) -> Option<f64>

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Auto Trait Implementations§

§

impl<'r> Freeze for Cursor<'r>

§

impl<'r> RefUnwindSafe for Cursor<'r>

§

impl<'r> Send for Cursor<'r>

§

impl<'r> Sync for Cursor<'r>

§

impl<'r> Unpin for Cursor<'r>

§

impl<'r> UnwindSafe for Cursor<'r>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.