pub struct StatePropertyReader<'a> { /* private fields */ }Expand description
Reading handle for properties.
This handle contains the type and the data of a property retrieved from the RetrieveHandle.
Implementations§
Source§impl<'a> StatePropertyReader<'a>
impl<'a> StatePropertyReader<'a>
Sourcepub fn new<T: ?Sized>(type_: URID<T>, body: Space<'a>) -> Self
pub fn new<T: ?Sized>(type_: URID<T>, body: Space<'a>) -> Self
Create a new reading handle with the given type and data.
Sourcepub fn read<A: Atom<'a, 'a>>(
&self,
urid: URID<A>,
parameter: A::ReadParameter,
) -> Result<A::ReadHandle, StateErr>
pub fn read<A: Atom<'a, 'a>>( &self, urid: URID<A>, parameter: A::ReadParameter, ) -> Result<A::ReadHandle, StateErr>
Try to interpret the property as an atom.
This works like any atom reader: You pass the URID of the atom type as well as the type-specific argument, and if the desired type is the actual type of the data, a read handle is returned.
If the desired and actual data types don’t match, Err(StateErr::BadType) is returned.
Auto Trait Implementations§
impl<'a> Freeze for StatePropertyReader<'a>
impl<'a> RefUnwindSafe for StatePropertyReader<'a>
impl<'a> Send for StatePropertyReader<'a>
impl<'a> Sync for StatePropertyReader<'a>
impl<'a> Unpin for StatePropertyReader<'a>
impl<'a> UnsafeUnpin for StatePropertyReader<'a>
impl<'a> UnwindSafe for StatePropertyReader<'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