pub trait Open<B: Backend>: ReceiveHeader<B> {
// Required method
fn build(self, settings: B::Settings) -> Result<B, B::Err>;
}
Expand description
Trait used to open a Backend
.
Should contain options used to open a specific backend. When a container is opened, this trait is used to open the related backend.
Any type that implements this Open
trait must also implement the
ReceiveHeader
trait because the header of the container is read here.
Finally, the container calls Open::build()
to create an instance of the
Backend
. The settings of the backend (extracted from the header) are
passed to the Open::build()
method and can be used to configure the
Backend
instance. The resulting backend instance should be able to
handle all operations on it. The Open::build()
method should validate
all its settings before returning the backend instance!
Required Methods§
Sourcefn build(self, settings: B::Settings) -> Result<B, B::Err>
fn build(self, settings: B::Settings) -> Result<B, B::Err>
Create an instance of the Backend
.
The container calls Create::build()
to create an instance of the
Backend
. The settings of the backend (extracted from the header) are
passed to the method and can be used to configure the Backend
. The
resulting backend instance should be able to handle all operations on
it. The method should validate all its settings before returning the
backend instance!