Skip to main content

CodamaProgramMacro

Struct CodamaProgramMacro 

Source
pub struct CodamaProgramMacro {
    pub name: Option<CamelCaseString>,
    pub address: Option<String>,
}
Expand description

The parsed arguments of a codama_program! function-like macro invocation.

Unlike the item-level #[codama(program(...))] directive — which declares a distinct program and therefore requires both name and address — the codama_program! macro overrides the primary program’s metadata. Both fields are optional (though at least one is required); any field left unset keeps the crate-derived default (the Cargo.toml package name and the declare_id! / package.metadata.solana.program-id address).

Fields§

§name: Option<CamelCaseString>§address: Option<String>

Implementations§

Source§

impl CodamaProgramMacro

Source

pub fn parse(tokens: TokenStream) -> Result<Self>

Parse the raw token stream passed to codama_program!(...).

Trait Implementations§

Source§

impl Debug for CodamaProgramMacro

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for CodamaProgramMacro

Source§

fn eq(&self, other: &CodamaProgramMacro) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CodamaProgramMacro

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<'a, T, U> TryFromFilter<'a, U> for T
where T: 'a, &'a T: TryFrom<U>,

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.