/// Attempt to fallibly decode & read a value from a linkstore in this binary.
///
/// ## Safety
///
/// This function is unsafe because malformed, corrupted or otherwise invalid data in the binary or unsound decoding implementations may cause undefined behavior.
Attempt to fallibly decode & read a value from a linkstore in this binary.
Attempt to fallibly decode & read a value from a linkstore in this binary .
pub unsafe fn try_read<T: EncodeLinkstore + TryDecodeLinkstore>(&mut self, name: &str) -> Result<TryEmbeddedValueIterator<'_, T>, Error> {
		let embeds = self.embeds.get(name).ok_or_else(|| Error::NotPresent(name.to_string()))?.as_ref();
		if !embeds.is_empty() && embeds[0].size != core::mem::size_of::<T>() as u64 {
			return Err(Error::MismatchedSize(embeds[0].size, core::mem::size_of::<T>()));
		}
		Ok(TryEmbeddedValueIterator::new(embeds))
	}
pub unsafe fn try_read < T : EncodeLinkstore + TryDecodeLinkstore > ( & mut self , name : & str ) -> Result < TryEmbeddedValueIterator < ' _ , T > , Error > { let embeds = self . embeds . get ( name ) . ok_or_else ( | | Error :: NotPresent ( name . to_string ( ) ) ) ? . as_ref ( ) ; if ! embeds . is_empty ( ) && embeds [ 0 ] . size != core :: mem :: size_of :: < T > ( ) as u64 { return Err ( Error :: MismatchedSize ( embeds [ 0 ] . size , core :: mem :: size_of :: < T > ( ) ) ) ; } Ok ( TryEmbeddedValueIterator :: new ( embeds ) ) }
Attempt to fallibly decode & read a value from a linkstore in this binary.
Attempt to fallibly decode & read a value from a linkstore in this binary .
&mut self
<not_specific>
name
&str
<not_specific>
safety
This function is unsafe because malformed, corrupted or otherwise invalid data in the binary or unsound decoding implementations may cause undefined behavior.
This function is unsafe because malformed corrupted or otherwise invalid data in the binary or unsound decoding implementations may cause undefined behavior .