pub trait Object<'doc>:
Serialize
+ Deserialize<'doc>
+ Clone {
// Required methods
fn get_type(&self) -> ObjectType;
fn has_key(&self, key: &str) -> bool;
fn has_index(&self, idx: usize) -> bool;
fn at_index<'a>(&'a self, idx: usize) -> Result<Option<&'a Self>>;
fn at_index_mut<'a>(
&'a mut self,
idx: usize,
) -> Result<Option<&'a mut Self>>;
fn at_key<'a>(&'a self, key: &str) -> Result<Option<&'a Self>>;
fn at_key_mut<'a>(&'a mut self, key: &str) -> Result<Option<&'a mut Self>>;
fn array_len(&self) -> Option<usize>;
}Required Methods§
fn get_type(&self) -> ObjectType
fn has_key(&self, key: &str) -> bool
fn has_index(&self, idx: usize) -> bool
fn at_index<'a>(&'a self, idx: usize) -> Result<Option<&'a Self>>
fn at_index_mut<'a>(&'a mut self, idx: usize) -> Result<Option<&'a mut Self>>
fn at_key<'a>(&'a self, key: &str) -> Result<Option<&'a Self>>
fn at_key_mut<'a>(&'a mut self, key: &str) -> Result<Option<&'a mut Self>>
fn array_len(&self) -> Option<usize>
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.