pub struct AttributeValue { /* private fields */ }
Expand description

An attribute value. The meaning of the bytes is dependent on the type of the attribute.

Implementations§

source§

impl AttributeValue

source

pub fn new(data: &[u8]) -> Result<AttributeValue, NewAttributeValueError>

Create a new Self from a slice of bytes. The slice must have a length of at most 31 bytes.

source

pub fn len(&self) -> usize

Get the length of the attribute value.

source

pub fn is_empty(&self) -> bool

Whether the attribute value has zero length.

Trait Implementations§

source§

impl AsRef<[u8]> for AttributeValue

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for AttributeValue

source§

fn clone(&self) -> AttributeValue

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AttributeValue

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Deserial for AttributeValue

source§

fn deserial<R>(source: &mut R) -> Result<AttributeValue, ParseError>
where R: Read,

Attempt to read a structure from a given source, failing if an error occurs during deserialization or reading.
source§

impl From<&[u8; 0]> for AttributeValue

source§

fn from(data: &[u8; 0]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 1]> for AttributeValue

source§

fn from(data: &[u8; 1]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 10]> for AttributeValue

source§

fn from(data: &[u8; 10]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 11]> for AttributeValue

source§

fn from(data: &[u8; 11]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 12]> for AttributeValue

source§

fn from(data: &[u8; 12]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 13]> for AttributeValue

source§

fn from(data: &[u8; 13]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 14]> for AttributeValue

source§

fn from(data: &[u8; 14]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 15]> for AttributeValue

source§

fn from(data: &[u8; 15]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 16]> for AttributeValue

source§

fn from(data: &[u8; 16]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 17]> for AttributeValue

source§

fn from(data: &[u8; 17]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 18]> for AttributeValue

source§

fn from(data: &[u8; 18]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 19]> for AttributeValue

source§

fn from(data: &[u8; 19]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 2]> for AttributeValue

source§

fn from(data: &[u8; 2]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 20]> for AttributeValue

source§

fn from(data: &[u8; 20]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 21]> for AttributeValue

source§

fn from(data: &[u8; 21]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 22]> for AttributeValue

source§

fn from(data: &[u8; 22]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 23]> for AttributeValue

source§

fn from(data: &[u8; 23]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 24]> for AttributeValue

source§

fn from(data: &[u8; 24]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 25]> for AttributeValue

source§

fn from(data: &[u8; 25]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 26]> for AttributeValue

source§

fn from(data: &[u8; 26]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 27]> for AttributeValue

source§

fn from(data: &[u8; 27]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 28]> for AttributeValue

source§

fn from(data: &[u8; 28]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 29]> for AttributeValue

source§

fn from(data: &[u8; 29]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 3]> for AttributeValue

source§

fn from(data: &[u8; 3]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 30]> for AttributeValue

source§

fn from(data: &[u8; 30]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 31]> for AttributeValue

source§

fn from(data: &[u8; 31]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 4]> for AttributeValue

source§

fn from(data: &[u8; 4]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 5]> for AttributeValue

source§

fn from(data: &[u8; 5]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 6]> for AttributeValue

source§

fn from(data: &[u8; 6]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 7]> for AttributeValue

source§

fn from(data: &[u8; 7]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 8]> for AttributeValue

source§

fn from(data: &[u8; 8]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<&[u8; 9]> for AttributeValue

source§

fn from(data: &[u8; 9]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 0]> for AttributeValue

source§

fn from(data: [u8; 0]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 1]> for AttributeValue

source§

fn from(data: [u8; 1]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 10]> for AttributeValue

source§

fn from(data: [u8; 10]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 11]> for AttributeValue

source§

fn from(data: [u8; 11]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 12]> for AttributeValue

source§

fn from(data: [u8; 12]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 13]> for AttributeValue

source§

fn from(data: [u8; 13]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 14]> for AttributeValue

source§

fn from(data: [u8; 14]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 15]> for AttributeValue

source§

fn from(data: [u8; 15]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 16]> for AttributeValue

source§

fn from(data: [u8; 16]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 17]> for AttributeValue

source§

fn from(data: [u8; 17]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 18]> for AttributeValue

source§

fn from(data: [u8; 18]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 19]> for AttributeValue

source§

fn from(data: [u8; 19]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 2]> for AttributeValue

source§

fn from(data: [u8; 2]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 20]> for AttributeValue

source§

fn from(data: [u8; 20]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 21]> for AttributeValue

source§

fn from(data: [u8; 21]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 22]> for AttributeValue

source§

fn from(data: [u8; 22]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 23]> for AttributeValue

source§

fn from(data: [u8; 23]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 24]> for AttributeValue

source§

fn from(data: [u8; 24]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 25]> for AttributeValue

source§

fn from(data: [u8; 25]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 26]> for AttributeValue

source§

fn from(data: [u8; 26]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 27]> for AttributeValue

source§

fn from(data: [u8; 27]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 28]> for AttributeValue

source§

fn from(data: [u8; 28]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 29]> for AttributeValue

source§

fn from(data: [u8; 29]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 3]> for AttributeValue

source§

fn from(data: [u8; 3]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 30]> for AttributeValue

source§

fn from(data: [u8; 30]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 31]> for AttributeValue

source§

fn from(data: [u8; 31]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 4]> for AttributeValue

source§

fn from(data: [u8; 4]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 5]> for AttributeValue

source§

fn from(data: [u8; 5]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 6]> for AttributeValue

source§

fn from(data: [u8; 6]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 7]> for AttributeValue

source§

fn from(data: [u8; 7]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 8]> for AttributeValue

source§

fn from(data: [u8; 8]) -> AttributeValue

Converts to this type from the input type.
source§

impl From<[u8; 9]> for AttributeValue

source§

fn from(data: [u8; 9]) -> AttributeValue

Converts to this type from the input type.
source§

impl PartialEq for AttributeValue

source§

fn eq(&self, other: &AttributeValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serial for AttributeValue

source§

fn serial<W>(&self, out: &mut W) -> Result<(), <W as Write>::Err>
where W: Write,

Attempt to write the structure into the provided writer, failing if only part of the structure could be written. Read more
source§

impl TryFrom<&[u8]> for AttributeValue

§

type Error = NewAttributeValueError

The type returned in the event of a conversion error.
source§

fn try_from( value: &[u8] ) -> Result<AttributeValue, <AttributeValue as TryFrom<&[u8]>>::Error>

Performs the conversion.
source§

impl Copy for AttributeValue

source§

impl Eq for AttributeValue

source§

impl StructuralPartialEq for AttributeValue

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Deletable for T
where T: Serialize,

source§

fn delete(self)

Delete all items that this type owns in the state.
source§

impl<D, S> DeserialWithState<S> for D
where D: Deserial, S: HasStateApi,

source§

fn deserial_with_state<R>(_state: &S, source: &mut R) -> Result<D, ParseError>
where R: Read,

Attempt to read a structure from a given source and state, failing if an error occurs during deserialization or reading.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> HasSize for T
where T: AsRef<[u8]>,

source§

fn size(&self) -> u32

Get the current byte size.
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<A> Serialize for A
where A: Deserial + Serial,