pub struct Val<'a>(/* private fields */);Implementations§
Source§impl<'a> Val<'a>
impl<'a> Val<'a>
pub fn new(value: &'a Value) -> Result<Self>
pub fn raw(&self) -> &Value
pub fn error_at<T: AsRef<str>>(&self, msg: T) -> Error
pub fn as_bool(&self) -> Result<bool>
pub fn as_usize(&self) -> Result<usize>
pub fn as_str(&self) -> Result<&str>
pub fn as_array(&self) -> Result<Vec<Val<'_>>>
pub fn as_object(&self) -> Result<IndexMap<Value, Val<'_>>>
Auto Trait Implementations§
impl<'a> !Send for Val<'a>
impl<'a> !Sync for Val<'a>
impl<'a> Freeze for Val<'a>
impl<'a> RefUnwindSafe for Val<'a>
impl<'a> Unpin for Val<'a>
impl<'a> UnsafeUnpin for Val<'a>
impl<'a> UnwindSafe for Val<'a>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more