api_impl::storage

Function get_object_buffer_attribute

Source
pub fn get_object_buffer_attribute<'a>(
    object: ObjectHandle,
    attribute_id: AttributeId,
    buffer: &'a mut [u8],
) -> Result<&'a [u8], GetObjectBufferAttributeError>
Expand description

Returns the requested buffer-type attribute associated with the given object, if any. It is written to the provided buffer and it is this written subslice that is returned.

Returns a wrapped value of Error::ItemNotFound if the object does not have such an attribute.

Returns a wrapped value of Error::ShortBuffer if the buffer was too small to read the attribute value into, along with the length of the attribute.

Panics if object is not a valid handle or if attribute_id is not of buffer type.