Trait Builder
pub trait Builder: Default + 'static {
type Config: Configurator;
// Required method
fn build(self) -> Result<impl Service, Error>;
}Expand description
OpenDAL uses Builder to set up a service.
A Builder allows developers to:
- Build a service through a builder-style API.
- Configure in-memory options, such as
customized_credential_load.
Users can usually use the Operator API instead of importing and using
Builder directly. For example:
use opendal_core::services::Memory;
use opendal_core::Operator;
async fn test() -> Result<()> {
// Create a memory backend builder.
let builder = Memory::default();
// Build an `Operator` to start operating the storage.
let op: Operator = Operator::new(builder)?;
Ok(())
}Required Associated Types§
type Config: Configurator
type Config: Configurator
Associated configuration.
Required Methods§
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.