Skip to main content

BridgeableArgs

Struct BridgeableArgs 

Source
pub struct BridgeableArgs {
    pub derives_to_pass: Vec<Ident>,
    pub compares_to_add: Vec<Ident>,
    pub doc_rec: DocRec,
}
Expand description

Parsed arguments for the #[bridgeable(...)] attribute macro.

Supports the following syntax:

#[bridgeable]                                    // defaults
#[bridgeable(Document)]                          // enable Documented impl
#[bridgeable(derive(Debug, PartialEq))]          // forward derives
#[bridgeable(derive(Debug, PartialEq), Document)] // both
  • derive(...) — derives to forward to the archived type (whitelisted to Debug, PartialEq, Eq, PartialOrd, Ord). PartialEq and PartialOrd also generate #[rkyv(compare(...))] attributes.
  • Document — opt-in flag that generates a Documented impl producing a JSON type spec for FFI/RPC consumers.

Fields§

§derives_to_pass: Vec<Ident>

Whitelisted derives to pass through to the rkyv Archived type.

§compares_to_add: Vec<Ident>

Comparison traits (PartialEq / PartialOrd) found in the derives — these also become #[rkyv(compare(...))] entries.

§doc_rec: DocRec

Implementations§

Source§

impl BridgeableArgs

Source

pub fn from_metas(metas: Punctuated<Meta, Comma>) -> Result<Self>

Build from an already-parsed Punctuated<Meta, Comma> list. This is the shared logic used by both Parse and a direct call site.

Trait Implementations§

Source§

impl Parse for BridgeableArgs

Allows parse_macro_input!(args as BridgeableArgs) in proc-macro crates.

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.