Skip to main content

reifydb_client_derive/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2026 ReifyDB
3#![cfg_attr(not(debug_assertions), deny(clippy::disallowed_methods))]
4#![cfg_attr(debug_assertions, warn(clippy::disallowed_methods))]
5#![allow(clippy::tabs_in_doc_comments)]
6// SPDX-License-Identifier: Apache-2.0
7// Copyright (c) 2026 ReifyDB
8// This file is licensed under the Apache-2.0, see license.md file
9
10use proc_macro::TokenStream;
11use reifydb_macro_impl::derive_from_frame_with_crate;
12
13/// Generated code references types from the `reifydb_client` crate.
14///
15/// # Attributes
16///
17/// - `#[frame(column = "name")]` - Use a different column name than the field name
18/// - `#[frame(optional)]` - Field is optional; missing columns or None values become None
19/// - `#[frame(coerce)]` - Use widening type coercion for this field
20/// - `#[frame(skip)]` - Skip this field (must implement Default)
21#[proc_macro_derive(FromFrame, attributes(frame))]
22pub fn derive_from_frame(input: TokenStream) -> TokenStream {
23	derive_from_frame_with_crate(input.into(), "reifydb_client::value").into()
24}