pub struct TraitDef {
pub name: String,
pub doc_comment: Option<DocComment>,
pub type_params: Option<Vec<TypeParam>>,
pub super_traits: Vec<TypeAnnotation>,
pub members: Vec<TraitMember>,
pub annotations: Vec<Annotation>,
pub is_comptime: bool,
}Expand description
Trait definition — supports required signatures and default methods.
trait Queryable<T> {
filter(predicate: (T) => bool): Self // required
method execute() -> Result<Table<T>> { // default
return Ok(self.filter(|_| true))
}
}Fields§
§name: String§doc_comment: Option<DocComment>§type_params: Option<Vec<TypeParam>>§super_traits: Vec<TypeAnnotation>Supertrait bounds: trait Foo: Bar + Baz { ... }
members: Vec<TraitMember>§annotations: Vec<Annotation>Annotations applied to the trait (e.g., @documented("...") trait Foo { ... })
is_comptime: boolcomptime trait Foo { ... } — parser-only flag (J-CT.0).
Type-checker validation lands in J-CT.1; comptime evaluator dispatch in
J-CT.2. Until those land, a true value here parses cleanly but has no
downstream semantic effect.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TraitDef
impl<'de> Deserialize<'de> for TraitDef
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 TraitDef
impl RefUnwindSafe for TraitDef
impl Send for TraitDef
impl Sync for TraitDef
impl Unpin for TraitDef
impl UnsafeUnpin for TraitDef
impl UnwindSafe for TraitDef
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