pub fn embed<T: EncodeLinkstore>(&mut self, name: &'a str, value: &'a T) -> Result<&mut Self, Error> {
		let embeds = self.embeds.get_mut(name).ok_or_else(|| Error::NotPresent(name.to_string()))?;

		for embed in embeds.as_mut() {
			if embed.size != core::mem::size_of::<T>() as u64 {
				return Err(Error::MismatchedSize(embed.size, core::mem::size_of::<T>()));
			}

			let bytes = if embed.little_endian { value.as_le_bytes() } else { value.as_be_bytes() };
			if bytes.len() != core::mem::size_of::<T>() {
				return Err(Error::MismatchedSize(bytes.len() as u64, core::mem::size_of::<T>()));
			}

			embed.bytes = LinkstoreBytes::Set(bytes);
		}

		Ok(self)
	}
/// Register a linkstore to be embedded.
Register a linkstore to be embedded.
Register a linkstore to be embedded .
pub fn embed<T: EncodeLinkstore>(&mut self, name: &'a str, value: &'a T) -> Result<&mut Self, Error> {
		let embeds = self.embeds.get_mut(name).ok_or_else(|| Error::NotPresent(name.to_string()))?;
		for embed in embeds.as_mut() {
			if embed.size != core::mem::size_of::<T>() as u64 {
				return Err(Error::MismatchedSize(embed.size, core::mem::size_of::<T>()));
			}
			let bytes = if embed.little_endian { value.as_le_bytes() } else { value.as_be_bytes() };
			if bytes.len() != core::mem::size_of::<T>() {
				return Err(Error::MismatchedSize(bytes.len() as u64, core::mem::size_of::<T>()));
			}
			embed.bytes = LinkstoreBytes::Set(bytes);
		}
		Ok(self)
	}
pub fn embed < T : EncodeLinkstore > ( & mut self , name : & ' a str , value : & ' a T ) -> Result < & mut Self , Error > { let embeds = self . embeds . get_mut ( name ) . ok_or_else ( | | Error :: NotPresent ( name . to_string ( ) ) ) ? ; for embed in embeds . as_mut ( ) { if embed . size != core :: mem :: size_of :: < T > ( ) as u64 { return Err ( Error :: MismatchedSize ( embed . size , core :: mem :: size_of :: < T > ( ) ) ) ; } let bytes = if embed . little_endian { value . as_le_bytes ( ) } else { value . as_be_bytes ( ) } ; if bytes . len ( ) != core :: mem :: size_of :: < T > ( ) { return Err ( Error :: MismatchedSize ( bytes . len ( ) as u64 , core :: mem :: size_of :: < T > ( ) ) ) ; } embed . bytes = LinkstoreBytes :: Set ( bytes ) ; } Ok ( self ) }
Register a linkstore to be embedded.
Register a linkstore to be embedded .
&mut self
name
&'a str
value
&'a T