simd_json::prelude

Trait ValueObjectAccessTryAsObject

Source
pub trait ValueObjectAccessTryAsObject {
    type Key: ?Sized;
    type Object: Object;

    // Required method
    fn try_get_object<Q>(
        &self,
        k: &Q,
    ) -> Result<Option<&Self::Object>, TryTypeError>
       where Self::Key: Borrow<Q>,
             Q: Hash + Eq + Ord + ?Sized;
}
Expand description

try_get_object access to object values in an object

Required Associated Types§

Source

type Key: ?Sized

The type for Objects

Source

type Object: Object

The object structure

Required Methods§

Source

fn try_get_object<Q>( &self, k: &Q, ) -> Result<Option<&Self::Object>, TryTypeError>
where Self::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as an object, returns an error if it isn’t an object

§Errors

if the requested type doesn’t match the actual type or the value is not an object

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.

Implementors§