pub struct Cursor<'r> { /* private fields */ }
Expand description
A Cursor
allows conventient navigation in a Value
AST.
Value
s can be converted to native Rust types if possible and
collections can be traversed using at
or get
.
Implementations§
Source§impl<'r> Cursor<'r>
impl<'r> Cursor<'r>
pub fn new(v: &'r Value) -> Cursor<'r>
pub fn at(&self, i: usize) -> Cursor<'r>
pub fn get(&self, k: Key) -> Cursor<'r>
pub fn field(&self, s: &str) -> Cursor<'r>
pub fn value(&self) -> Option<&Value>
pub fn opt(&self) -> Option<Cursor<'r>>
pub fn maybe(&self) -> Option<Cursor<'r>>
pub fn bool(&self) -> Option<bool>
pub fn bytes(&self) -> Option<&Bytes>
pub fn bytes_plain(&self) -> Option<&Vec<u8>>
pub fn bytes_chunked(&self) -> Option<&LinkedList<Vec<u8>>>
pub fn text(&self) -> Option<&Text>
pub fn text_plain(&self) -> Option<&String>
pub fn text_chunked(&self) -> Option<&LinkedList<String>>
pub fn float32(&self) -> Option<f32>
pub fn float64(&self) -> Option<f64>
pub fn u8(&self) -> Option<u8>
pub fn u16(&self) -> Option<u16>
pub fn u32(&self) -> Option<u32>
pub fn u64(&self) -> Option<u64>
pub fn i8(&self) -> Option<i8>
pub fn i16(&self) -> Option<i16>
pub fn i32(&self) -> Option<i32>
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> 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