Skip to main content

ObjectStoreBuilder

Trait ObjectStoreBuilder 

pub trait ObjectStoreBuilder: 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

Associated configuration.

Required Methods§

fn build(self) -> Result<impl Service, Error>

Consume the builder to build a service.

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§

§

impl Builder for ()

Dummy implementation of builder

§

type Config = ()

§

fn build(self) -> Result<impl Service, Error>

Implementors§