ValueWrapper

Struct ValueWrapper 

Source
pub struct ValueWrapper<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> ValueWrapper<'a>

Source

pub fn new(value: &'a Value) -> Self

创建一个新的实例

§参数
  • value - 指向Value的引用
§返回值

返回包含指定value的新实例

Source

pub fn get(&self, key: &'a str) -> Vec<&'a Value>

根据键名获取对应的值

该函数支持通过点号分隔的多层键名来访问嵌套的数据结构, 也支持在数组中查找指定键名的值。

§参数
  • key - 要查找的键名,可以是单层键名或点号分隔的多层键名
§返回值

返回包含查找到的值的向量,如果未找到则包含Null值

Auto Trait Implementations§

§

impl<'a> Freeze for ValueWrapper<'a>

§

impl<'a> RefUnwindSafe for ValueWrapper<'a>

§

impl<'a> Send for ValueWrapper<'a>

§

impl<'a> Sync for ValueWrapper<'a>

§

impl<'a> Unpin for ValueWrapper<'a>

§

impl<'a> UnwindSafe for ValueWrapper<'a>

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.