liurenjie1024 commented on code in PR #186: URL: https://github.com/apache/iceberg-rust/pull/186#discussion_r1477195324
########## crates/iceberg/src/catalog/mod.rs: ########## @@ -25,16 +25,16 @@ use crate::spec::{ }; use crate::table::Table; use crate::{Error, ErrorKind, Result}; -use async_trait::async_trait; use std::collections::HashMap; use std::mem::take; use std::ops::Deref; use typed_builder::TypedBuilder; use uuid::Uuid; /// The catalog API for Iceberg Rust. -#[async_trait] -pub trait Catalog: std::fmt::Debug { +/// see https://blog.rust-lang.org/2023/12/21/async-fn-rpit-in-traits.html +#[trait_variant::make(Catalog: Send)] +pub trait LocalCatalog: std::fmt::Debug { Review Comment: I think the better approach would be like `FileWriter` trait, which adds `Send` for each return type: ```rust pub trait Catalog: Debug + Send { fn list_namespace(&self, parent: Option<&NamespeceIdent>) -> impl Future<Output = Result<Vec<NamespaceIdent>>> + Send; } ``` ########## crates/iceberg/src/catalog/mod.rs: ########## @@ -25,16 +25,16 @@ use crate::spec::{ }; use crate::table::Table; use crate::{Error, ErrorKind, Result}; -use async_trait::async_trait; use std::collections::HashMap; use std::mem::take; use std::ops::Deref; use typed_builder::TypedBuilder; use uuid::Uuid; /// The catalog API for Iceberg Rust. -#[async_trait] -pub trait Catalog: std::fmt::Debug { +/// see https://blog.rust-lang.org/2023/12/21/async-fn-rpit-in-traits.html +#[trait_variant::make(Catalog: Send)] +pub trait LocalCatalog: std::fmt::Debug { Review Comment: Why we need this `LocalCatalog` variant? I think it would be enough to have a thread safe one. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org