pub struct TreeObjectSpace { /* private fields */ }
Expand description
A thread-safe reference ObjectSpace
implementation
§Implementation
A TreeObjectSpace
is a HashMap
between a TypeId
and the actual Entry
structure holding the structs.
Before structs are stored in Entry
,
they are serialized into a JSON-like structure and then flattened.
An Entry
is a HashMap
whose key is a flattened field and
value is a BTreeMap
between possible values of the field
and the Vec
of structs containing the corresponding value of such field.
Mutex
is used sparingly to ensure blocking read
and take
calls do not hijack CPU cycles
Implementations§
Source§impl TreeObjectSpace
impl TreeObjectSpace
pub fn new() -> TreeObjectSpace
Trait Implementations§
Source§impl Default for TreeObjectSpace
impl Default for TreeObjectSpace
Source§fn default() -> TreeObjectSpace
fn default() -> TreeObjectSpace
Returns the “default value” for a type. Read more
Source§impl ObjectSpace for TreeObjectSpace
impl ObjectSpace for TreeObjectSpace
Source§fn write<T>(&self, obj: T)where
for<'de> T: Serialize + Deserialize<'de> + 'static,
fn write<T>(&self, obj: T)where
for<'de> T: Serialize + Deserialize<'de> + 'static,
Add a struct to the object space. Read more
Source§fn try_read<T>(&self) -> Option<T>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
fn try_read<T>(&self) -> Option<T>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
Return a copy of a struct of type T.
The operation is non-blocking
and will returns None if no struct satisfies condition. Read more
Source§fn read_all<'a, T>(&'a self) -> Box<dyn Iterator<Item = T> + 'a>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
fn read_all<'a, T>(&'a self) -> Box<dyn Iterator<Item = T> + 'a>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
Return copies of all structs of type T.
The operation is non-blocking and will returns None if no struct satisfies condition. Read more
Source§fn read<T>(&self) -> Twhere
for<'de> T: Serialize + Deserialize<'de> + 'static,
fn read<T>(&self) -> Twhere
for<'de> T: Serialize + Deserialize<'de> + 'static,
Return a copy of a struct of type T.
The operation blocks until such a struct is found. Read more
Source§fn try_take<T>(&self) -> Option<T>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
fn try_take<T>(&self) -> Option<T>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
Remove and return a struct of type T.
The operation is non-blocking and will returns None if no struct satisfies condition. Read more
Source§impl RangeLookupObjectSpace<String> for TreeObjectSpace
impl RangeLookupObjectSpace<String> for TreeObjectSpace
Source§fn try_read_by_range<T, R>(&self, field: &str, range: R) -> Option<T>
fn try_read_by_range<T, R>(&self, field: &str, range: R) -> Option<T>
Given a path to an element of the struct and a range of possible values,
return a copy of a struct whose specified element is within the range.
The operation is non-blocking and will returns None if no struct satisfies condition. Read more
Source§fn read_all_by_range<'a, T, R>(
&'a self,
field: &str,
range: R,
) -> Box<dyn Iterator<Item = T> + 'a>
fn read_all_by_range<'a, T, R>( &'a self, field: &str, range: R, ) -> Box<dyn Iterator<Item = T> + 'a>
Given a path to an element of the struct and a range of possible values,
return copies of all structs whose specified element is within the range. Read more
Source§fn read_by_range<T, R>(&self, field: &str, range: R) -> T
fn read_by_range<T, R>(&self, field: &str, range: R) -> T
Given a path to an element of the struct and a range of possible values,
return a copy of a struct whose specified element is within the range.
The operation blocks until a struct satisfies the condition is found. Read more
Source§fn try_take_by_range<T, R>(&self, field: &str, range: R) -> Option<T>
fn try_take_by_range<T, R>(&self, field: &str, range: R) -> Option<T>
Given a path to an element of the struct and a range of possible values,
remove and return a struct whose specified element is within the range.
The operation is non-blocking and will returns None if no struct satisfies condition. Read more
Source§fn take_all_by_range<'a, T, R>(
&'a self,
field: &str,
range: R,
) -> Box<dyn Iterator<Item = T> + 'a>
fn take_all_by_range<'a, T, R>( &'a self, field: &str, range: R, ) -> Box<dyn Iterator<Item = T> + 'a>
Given a path to an element of the struct and a range of possible values,
remove and return all structs whose specified element is within the range. Read more
Source§fn take_by_range<T, R>(&self, field: &str, range: R) -> T
fn take_by_range<T, R>(&self, field: &str, range: R) -> T
Given a path to an element of the struct and a range of possible values,
remove and return a struct whose specified element is within the range.
The operation blocks until a struct satisfies the condition is found. Read more
Source§impl RangeLookupObjectSpace<f64> for TreeObjectSpace
impl RangeLookupObjectSpace<f64> for TreeObjectSpace
Source§fn try_read_by_range<T, R>(&self, field: &str, range: R) -> Option<T>
fn try_read_by_range<T, R>(&self, field: &str, range: R) -> Option<T>
Given a path to an element of the struct and a range of possible values,
return a copy of a struct whose specified element is within the range.
The operation is non-blocking and will returns None if no struct satisfies condition. Read more
Source§fn read_all_by_range<'a, T, R>(
&'a self,
field: &str,
range: R,
) -> Box<dyn Iterator<Item = T> + 'a>
fn read_all_by_range<'a, T, R>( &'a self, field: &str, range: R, ) -> Box<dyn Iterator<Item = T> + 'a>
Given a path to an element of the struct and a range of possible values,
return copies of all structs whose specified element is within the range. Read more
Source§fn read_by_range<T, R>(&self, field: &str, range: R) -> T
fn read_by_range<T, R>(&self, field: &str, range: R) -> T
Given a path to an element of the struct and a range of possible values,
return a copy of a struct whose specified element is within the range.
The operation blocks until a struct satisfies the condition is found. Read more
Source§fn try_take_by_range<T, R>(&self, field: &str, range: R) -> Option<T>
fn try_take_by_range<T, R>(&self, field: &str, range: R) -> Option<T>
Given a path to an element of the struct and a range of possible values,
remove and return a struct whose specified element is within the range.
The operation is non-blocking and will returns None if no struct satisfies condition. Read more
Source§fn take_all_by_range<'a, T, R>(
&'a self,
field: &str,
range: R,
) -> Box<dyn Iterator<Item = T> + 'a>
fn take_all_by_range<'a, T, R>( &'a self, field: &str, range: R, ) -> Box<dyn Iterator<Item = T> + 'a>
Given a path to an element of the struct and a range of possible values,
remove and return all structs whose specified element is within the range. Read more
Source§fn take_by_range<T, R>(&self, field: &str, range: R) -> T
fn take_by_range<T, R>(&self, field: &str, range: R) -> T
Given a path to an element of the struct and a range of possible values,
remove and return a struct whose specified element is within the range.
The operation blocks until a struct satisfies the condition is found. Read more
Source§impl RangeLookupObjectSpace<i64> for TreeObjectSpace
impl RangeLookupObjectSpace<i64> for TreeObjectSpace
Source§fn try_read_by_range<T, R>(&self, field: &str, range: R) -> Option<T>
fn try_read_by_range<T, R>(&self, field: &str, range: R) -> Option<T>
Given a path to an element of the struct and a range of possible values,
return a copy of a struct whose specified element is within the range.
The operation is non-blocking and will returns None if no struct satisfies condition. Read more
Source§fn read_all_by_range<'a, T, R>(
&'a self,
field: &str,
range: R,
) -> Box<dyn Iterator<Item = T> + 'a>
fn read_all_by_range<'a, T, R>( &'a self, field: &str, range: R, ) -> Box<dyn Iterator<Item = T> + 'a>
Given a path to an element of the struct and a range of possible values,
return copies of all structs whose specified element is within the range. Read more
Source§fn read_by_range<T, R>(&self, field: &str, range: R) -> T
fn read_by_range<T, R>(&self, field: &str, range: R) -> T
Given a path to an element of the struct and a range of possible values,
return a copy of a struct whose specified element is within the range.
The operation blocks until a struct satisfies the condition is found. Read more
Source§fn try_take_by_range<T, R>(&self, field: &str, range: R) -> Option<T>
fn try_take_by_range<T, R>(&self, field: &str, range: R) -> Option<T>
Given a path to an element of the struct and a range of possible values,
remove and return a struct whose specified element is within the range.
The operation is non-blocking and will returns None if no struct satisfies condition. Read more
Source§fn take_all_by_range<'a, T, R>(
&'a self,
field: &str,
range: R,
) -> Box<dyn Iterator<Item = T> + 'a>
fn take_all_by_range<'a, T, R>( &'a self, field: &str, range: R, ) -> Box<dyn Iterator<Item = T> + 'a>
Given a path to an element of the struct and a range of possible values,
remove and return all structs whose specified element is within the range. Read more
Source§fn take_by_range<T, R>(&self, field: &str, range: R) -> T
fn take_by_range<T, R>(&self, field: &str, range: R) -> T
Given a path to an element of the struct and a range of possible values,
remove and return a struct whose specified element is within the range.
The operation blocks until a struct satisfies the condition is found. Read more
Source§impl ValueLookupObjectSpace<String> for TreeObjectSpace
impl ValueLookupObjectSpace<String> for TreeObjectSpace
Source§fn try_read_by_value<T>(&self, field: &str, key: &String) -> Option<T>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
fn try_read_by_value<T>(&self, field: &str, key: &String) -> Option<T>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
return a copy of a struct whose specified element of the specified value.
The operation is non-blocking and will returns None if no struct satisfies condition. Read more
Source§fn read_all_by_value<'a, T>(
&'a self,
field: &str,
key: &String,
) -> Box<dyn Iterator<Item = T> + 'a>where
for<'de> T: Deserialize<'de> + 'static,
fn read_all_by_value<'a, T>(
&'a self,
field: &str,
key: &String,
) -> Box<dyn Iterator<Item = T> + 'a>where
for<'de> T: Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
return copies of all structs whose specified element of the specified value. Read more
Source§fn read_by_value<T>(&self, field: &str, key: &String) -> Twhere
for<'de> T: Serialize + Deserialize<'de> + 'static,
fn read_by_value<T>(&self, field: &str, key: &String) -> Twhere
for<'de> T: Serialize + Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
return a copy of a struct whose specified element of the specified value.
The operation is blocks until an element satisfies the condition is found. Read more
Source§fn try_take_by_value<T>(&self, field: &str, key: &String) -> Option<T>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
fn try_take_by_value<T>(&self, field: &str, key: &String) -> Option<T>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
remove and return a struct whose specified element of the specified value.
The operation is non-blocking and will returns None if no struct satisfies condition. Read more
Source§fn take_all_by_value<'a, T>(
&'a self,
field: &str,
key: &String,
) -> Box<dyn Iterator<Item = T> + 'a>where
for<'de> T: Deserialize<'de> + 'static,
fn take_all_by_value<'a, T>(
&'a self,
field: &str,
key: &String,
) -> Box<dyn Iterator<Item = T> + 'a>where
for<'de> T: Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
remove and return all structs whose specified element of the specified value. Read more
Source§fn take_by_value<T>(&self, field: &str, key: &String) -> Twhere
for<'de> T: Serialize + Deserialize<'de> + 'static,
fn take_by_value<T>(&self, field: &str, key: &String) -> Twhere
for<'de> T: Serialize + Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
remove and return a struct whose specified element of the specified value.
The operation is blocks until an element satisfies the condition is found. Read more
Source§impl ValueLookupObjectSpace<bool> for TreeObjectSpace
impl ValueLookupObjectSpace<bool> for TreeObjectSpace
Source§fn try_read_by_value<T>(&self, field: &str, key: &bool) -> Option<T>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
fn try_read_by_value<T>(&self, field: &str, key: &bool) -> Option<T>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
return a copy of a struct whose specified element of the specified value.
The operation is non-blocking and will returns None if no struct satisfies condition. Read more
Source§fn read_all_by_value<'a, T>(
&'a self,
field: &str,
key: &bool,
) -> Box<dyn Iterator<Item = T> + 'a>where
for<'de> T: Deserialize<'de> + 'static,
fn read_all_by_value<'a, T>(
&'a self,
field: &str,
key: &bool,
) -> Box<dyn Iterator<Item = T> + 'a>where
for<'de> T: Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
return copies of all structs whose specified element of the specified value. Read more
Source§fn read_by_value<T>(&self, field: &str, key: &bool) -> Twhere
for<'de> T: Serialize + Deserialize<'de> + 'static,
fn read_by_value<T>(&self, field: &str, key: &bool) -> Twhere
for<'de> T: Serialize + Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
return a copy of a struct whose specified element of the specified value.
The operation is blocks until an element satisfies the condition is found. Read more
Source§fn try_take_by_value<T>(&self, field: &str, key: &bool) -> Option<T>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
fn try_take_by_value<T>(&self, field: &str, key: &bool) -> Option<T>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
remove and return a struct whose specified element of the specified value.
The operation is non-blocking and will returns None if no struct satisfies condition. Read more
Source§fn take_all_by_value<'a, T>(
&'a self,
field: &str,
key: &bool,
) -> Box<dyn Iterator<Item = T> + 'a>where
for<'de> T: Deserialize<'de> + 'static,
fn take_all_by_value<'a, T>(
&'a self,
field: &str,
key: &bool,
) -> Box<dyn Iterator<Item = T> + 'a>where
for<'de> T: Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
remove and return all structs whose specified element of the specified value. Read more
Source§fn take_by_value<T>(&self, field: &str, key: &bool) -> Twhere
for<'de> T: Serialize + Deserialize<'de> + 'static,
fn take_by_value<T>(&self, field: &str, key: &bool) -> Twhere
for<'de> T: Serialize + Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
remove and return a struct whose specified element of the specified value.
The operation is blocks until an element satisfies the condition is found. Read more
Source§impl ValueLookupObjectSpace<f64> for TreeObjectSpace
impl ValueLookupObjectSpace<f64> for TreeObjectSpace
Source§fn try_read_by_value<T>(&self, field: &str, key: &f64) -> Option<T>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
fn try_read_by_value<T>(&self, field: &str, key: &f64) -> Option<T>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
return a copy of a struct whose specified element of the specified value.
The operation is non-blocking and will returns None if no struct satisfies condition. Read more
Source§fn read_all_by_value<'a, T>(
&'a self,
field: &str,
key: &f64,
) -> Box<dyn Iterator<Item = T> + 'a>where
for<'de> T: Deserialize<'de> + 'static,
fn read_all_by_value<'a, T>(
&'a self,
field: &str,
key: &f64,
) -> Box<dyn Iterator<Item = T> + 'a>where
for<'de> T: Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
return copies of all structs whose specified element of the specified value. Read more
Source§fn read_by_value<T>(&self, field: &str, key: &f64) -> Twhere
for<'de> T: Serialize + Deserialize<'de> + 'static,
fn read_by_value<T>(&self, field: &str, key: &f64) -> Twhere
for<'de> T: Serialize + Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
return a copy of a struct whose specified element of the specified value.
The operation is blocks until an element satisfies the condition is found. Read more
Source§fn try_take_by_value<T>(&self, field: &str, key: &f64) -> Option<T>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
fn try_take_by_value<T>(&self, field: &str, key: &f64) -> Option<T>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
remove and return a struct whose specified element of the specified value.
The operation is non-blocking and will returns None if no struct satisfies condition. Read more
Source§fn take_all_by_value<'a, T>(
&'a self,
field: &str,
key: &f64,
) -> Box<dyn Iterator<Item = T> + 'a>where
for<'de> T: Deserialize<'de> + 'static,
fn take_all_by_value<'a, T>(
&'a self,
field: &str,
key: &f64,
) -> Box<dyn Iterator<Item = T> + 'a>where
for<'de> T: Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
remove and return all structs whose specified element of the specified value. Read more
Source§fn take_by_value<T>(&self, field: &str, key: &f64) -> Twhere
for<'de> T: Serialize + Deserialize<'de> + 'static,
fn take_by_value<T>(&self, field: &str, key: &f64) -> Twhere
for<'de> T: Serialize + Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
remove and return a struct whose specified element of the specified value.
The operation is blocks until an element satisfies the condition is found. Read more
Source§impl ValueLookupObjectSpace<i64> for TreeObjectSpace
impl ValueLookupObjectSpace<i64> for TreeObjectSpace
Source§fn try_read_by_value<T>(&self, field: &str, key: &i64) -> Option<T>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
fn try_read_by_value<T>(&self, field: &str, key: &i64) -> Option<T>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
return a copy of a struct whose specified element of the specified value.
The operation is non-blocking and will returns None if no struct satisfies condition. Read more
Source§fn read_all_by_value<'a, T>(
&'a self,
field: &str,
key: &i64,
) -> Box<dyn Iterator<Item = T> + 'a>where
for<'de> T: Deserialize<'de> + 'static,
fn read_all_by_value<'a, T>(
&'a self,
field: &str,
key: &i64,
) -> Box<dyn Iterator<Item = T> + 'a>where
for<'de> T: Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
return copies of all structs whose specified element of the specified value. Read more
Source§fn read_by_value<T>(&self, field: &str, key: &i64) -> Twhere
for<'de> T: Serialize + Deserialize<'de> + 'static,
fn read_by_value<T>(&self, field: &str, key: &i64) -> Twhere
for<'de> T: Serialize + Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
return a copy of a struct whose specified element of the specified value.
The operation is blocks until an element satisfies the condition is found. Read more
Source§fn try_take_by_value<T>(&self, field: &str, key: &i64) -> Option<T>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
fn try_take_by_value<T>(&self, field: &str, key: &i64) -> Option<T>where
for<'de> T: Serialize + Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
remove and return a struct whose specified element of the specified value.
The operation is non-blocking and will returns None if no struct satisfies condition. Read more
Source§fn take_all_by_value<'a, T>(
&'a self,
field: &str,
key: &i64,
) -> Box<dyn Iterator<Item = T> + 'a>where
for<'de> T: Deserialize<'de> + 'static,
fn take_all_by_value<'a, T>(
&'a self,
field: &str,
key: &i64,
) -> Box<dyn Iterator<Item = T> + 'a>where
for<'de> T: Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
remove and return all structs whose specified element of the specified value. Read more
Source§fn take_by_value<T>(&self, field: &str, key: &i64) -> Twhere
for<'de> T: Serialize + Deserialize<'de> + 'static,
fn take_by_value<T>(&self, field: &str, key: &i64) -> Twhere
for<'de> T: Serialize + Deserialize<'de> + 'static,
Given a path to an element of the struct and a possible value,
remove and return a struct whose specified element of the specified value.
The operation is blocks until an element satisfies the condition is found. Read more
Auto Trait Implementations§
impl !Freeze for TreeObjectSpace
impl !RefUnwindSafe for TreeObjectSpace
impl Send for TreeObjectSpace
impl Sync for TreeObjectSpace
impl Unpin for TreeObjectSpace
impl UnwindSafe for TreeObjectSpace
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