pub struct Column<F> { /* private fields */ }Expand description
类型安全的列引用(对标 Java SFunction<T, ?> 的编译期列解析)。
Java 中 LambdaQueryWrapper 通过 User::getName 序列化 lambda 解析列名;
Rust 没有运行时 lambda 反射,改用 Column<F> + derive 宏在编译期生成列名。
F 是字段的 Rust 类型(如 String、i64),用于编译期类型检查。
§用法
通常由 #[derive(TableName)] 宏自动生成,不需要手动构造:
ⓘ
use rbatis_plus::core::conditions::query::lambda_query_wrapper::Column;
// derive 宏会生成:User::column_name() -> Column<String>
let col: Column<String> = Column::new("user_name");
assert_eq!(col.name(), "user_name");Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for Column<F>where
PhantomData<F>: Freeze,
impl<F> RefUnwindSafe for Column<F>where
PhantomData<F>: RefUnwindSafe,
impl<F> Send for Column<F>where
PhantomData<F>: Send,
impl<F> Sync for Column<F>where
PhantomData<F>: Sync,
impl<F> Unpin for Column<F>where
PhantomData<F>: Unpin,
impl<F> UnsafeUnpin for Column<F>where
PhantomData<F>: UnsafeUnpin,
impl<F> UnwindSafe for Column<F>where
PhantomData<F>: UnwindSafe,
Blanket Implementations§
Source§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
Mutably borrows from an owned value. Read more