pub struct RestSessionCatalogBuilder { /* private fields */ }Expand description
Builder for an unbound RestSessionCatalog.
Unlike RestCatalogBuilder, the resulting catalog accepts a
[SessionContext] with each [SessionCatalog] operation.
Implementations§
Source§impl RestSessionCatalogBuilder
impl RestSessionCatalogBuilder
Sourcepub fn with_client(self, client: Client) -> Self
pub fn with_client(self, client: Client) -> Self
Configures the catalog with a custom HTTP client.
Sourcepub fn with_auth_manager(self, auth_manager: Arc<dyn AuthManager>) -> Self
pub fn with_auth_manager(self, auth_manager: Arc<dyn AuthManager>) -> Self
Injects a custom auth manager, overriding the rest.auth.type configuration.
Sourcepub fn with_storage_factory(
self,
storage_factory: Arc<dyn StorageFactory>,
) -> Self
pub fn with_storage_factory( self, storage_factory: Arc<dyn StorageFactory>, ) -> Self
Set a custom StorageFactory to use for storage operations.
When a StorageFactory is provided, the catalog will use it to build FileIO instances for all storage operations instead of using the default factory.
§Arguments
storage_factory- The StorageFactory to use for creating storage instances
§Example
use iceberg::io::StorageFactory;
use iceberg_catalog_rest::RestSessionCatalogBuilder;
use iceberg_storage_opendal::OpenDalStorageFactory;
use std::sync::Arc;
let catalog = RestSessionCatalogBuilder::default()
.with_storage_factory(Arc::new(OpenDalStorageFactory::S3 {
customized_credential_load: None,
}))
.load("my_catalog", props)
.await?;Sourcepub fn with_kms_client_factory(
self,
kms_client_factory: Arc<dyn KmsClientFactory>,
) -> Self
pub fn with_kms_client_factory( self, kms_client_factory: Arc<dyn KmsClientFactory>, ) -> Self
Set a [KmsClientFactory] to enable table encryption.
When provided, the catalog calls the factory once during
load with the catalog properties to create a shared
[KeyManagementClient].
That client is then passed to each table’s TableBuilder so tables
with encryption.key-id set can construct an EncryptionManager.
§Example
use iceberg::encryption::kms::KmsClientFactory;
use iceberg_catalog_rest::RestSessionCatalogBuilder;
use std::sync::Arc;
let catalog = RestSessionCatalogBuilder::default()
.with_kms_client_factory(Arc::new(MyKmsClientFactory))
.load("my_catalog", props)
.await?;Sourcepub fn with_runtime(self, runtime: Runtime) -> Self
pub fn with_runtime(self, runtime: Runtime) -> Self
Set a custom tokio Runtime to use for spawning async tasks.
When a Runtime is provided, the catalog will propagate it to all tables it creates. Tasks such as scan planning and delete file processing will be spawned on this runtime.
Sourcepub fn load(
self,
name: impl Into<String>,
props: HashMap<String, String>,
) -> impl Future<Output = Result<RestSessionCatalog>> + Send
pub fn load( self, name: impl Into<String>, props: HashMap<String, String>, ) -> impl Future<Output = Result<RestSessionCatalog>> + Send
Creates a new session catalog instance.
The server configuration handshake, endpoint negotiation, and authentication sessions are initialized lazily on the first operation.
Trait Implementations§
Source§impl Debug for RestSessionCatalogBuilder
impl Debug for RestSessionCatalogBuilder
Auto Trait Implementations§
impl Freeze for RestSessionCatalogBuilder
impl !RefUnwindSafe for RestSessionCatalogBuilder
impl Send for RestSessionCatalogBuilder
impl Sync for RestSessionCatalogBuilder
impl Unpin for RestSessionCatalogBuilder
impl UnsafeUnpin for RestSessionCatalogBuilder
impl !UnwindSafe for RestSessionCatalogBuilder
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Any.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Any.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more