Trait Header

Source
pub trait Header {
    type Error: Error + 'static;

    // Required method
    fn try_header(
        &self,
        id: impl AsRef<oid>,
    ) -> Result<Option<Header>, Self::Error>;
}
Expand description

A way to obtain object properties without fully decoding it.

Required Associated Types§

Source

type Error: Error + 'static

The error returned by try_header().

Required Methods§

Source

fn try_header(&self, id: impl AsRef<oid>) -> Result<Option<Header>, Self::Error>

Try to read the header of the object associated with id or return None if it could not be found.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> Header for &T
where T: Header,

Source§

type Error = <T as Header>::Error

Source§

fn try_header(&self, id: impl AsRef<oid>) -> Result<Option<Header>, Self::Error>

Source§

impl<T> Header for Rc<T>
where T: Header,

Source§

type Error = <T as Header>::Error

Source§

fn try_header(&self, id: impl AsRef<oid>) -> Result<Option<Header>, Self::Error>

Source§

impl<T> Header for Arc<T>
where T: Header,

Source§

type Error = <T as Header>::Error

Source§

fn try_header(&self, id: impl AsRef<oid>) -> Result<Option<Header>, Self::Error>

Implementors§

Source§

impl<S> Header for Handle<S>
where S: Deref<Target = Store> + Clone,

Source§

impl<S> Header for Cache<S>
where S: Header,

Source§

type Error = <S as Header>::Error