pub struct InterfaceDef {
pub name: String,
pub methods: Vec<InterfaceMethodReq>,
pub is_pub: bool,
pub file_id: FileId,
}Expand description
Definition of an interface (ADR-0056).
Stores the resolved method-signature requirements. The order of methods
is significant: it is the vtable slot order used by the runtime-dispatch
path (Phase 4). It also controls error reporting, where missing methods
are listed in declaration order.
is_pub and file_id are populated now and consumed in later phases
(visibility checks during cross-module conformance).
Fields§
§name: StringInterface name (as written in source).
methods: Vec<InterfaceMethodReq>Required method signatures, in declaration order.
is_pub: boolWhether this interface is public (module-system future work).
file_id: FileIdFile ID this interface was declared in.
Implementations§
Source§impl InterfaceDef
impl InterfaceDef
Sourcepub fn find_method(&self, name: &str) -> Option<(usize, &InterfaceMethodReq)>
pub fn find_method(&self, name: &str) -> Option<(usize, &InterfaceMethodReq)>
Find a required method by name. Returns its slot index plus the requirement. Used by later phases for vtable lookup.
Trait Implementations§
Source§impl Clone for InterfaceDef
impl Clone for InterfaceDef
Source§fn clone(&self) -> InterfaceDef
fn clone(&self) -> InterfaceDef
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InterfaceDef
impl Debug for InterfaceDef
Source§impl<'de> Deserialize<'de> for InterfaceDef
impl<'de> Deserialize<'de> for InterfaceDef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for InterfaceDef
impl RefUnwindSafe for InterfaceDef
impl Send for InterfaceDef
impl Sync for InterfaceDef
impl Unpin for InterfaceDef
impl UnsafeUnpin for InterfaceDef
impl UnwindSafe for InterfaceDef
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
An iterator over the items within this container, by reference.
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
Check whether an item is contained within this sequence.
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
Convert an item of the sequence into a [
MaybeRef].