pub struct PactInterface {
pub name: String,
pub metadata: Vec<Metadata>,
pub uses: Vec<PactUse>,
pub type_params: Vec<TypeParam>,
pub types: Vec<TypeDef>,
pub imports: Vec<PactImport>,
pub exports: Vec<PactExport>,
pub children: Vec<PactInterface>,
pub aliases: Vec<InterfaceAlias>,
}Expand description
A parsed Pact interface definition.
Fields§
§name: StringInterface name
metadata: Vec<Metadata>Metadata annotations
uses: Vec<PactUse>Use declarations (brings types from other interfaces into scope)
type_params: Vec<TypeParam>Type parameters (generics)
types: Vec<TypeDef>Type definitions
imports: Vec<PactImport>Imported items
exports: Vec<PactExport>Exported items
children: Vec<PactInterface>Nested interfaces
aliases: Vec<InterfaceAlias>Interface aliases (transformed interfaces)
Implementations§
Source§impl PactInterface
impl PactInterface
pub fn new(name: impl Into<String>) -> Self
Sourcepub fn to_arena(&self) -> Arena
pub fn to_arena(&self) -> Arena
Convert this PactInterface to an Arena representation.
Note: Metadata and type parameters are not included in Arena
(they’re Pact-specific). Use metadata() and type_params
directly if you need them.
Sourcepub fn get_metadata(&self, name: &str) -> Option<&Metadata>
pub fn get_metadata(&self, name: &str) -> Option<&Metadata>
Get metadata value by name.
Trait Implementations§
Source§impl Clone for PactInterface
impl Clone for PactInterface
Source§fn clone(&self) -> PactInterface
fn clone(&self) -> PactInterface
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PactInterface
impl RefUnwindSafe for PactInterface
impl Send for PactInterface
impl Sync for PactInterface
impl Unpin for PactInterface
impl UnsafeUnpin for PactInterface
impl UnwindSafe for PactInterface
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more