Skip to main content

DeclKind

Enum DeclKind 

Source
pub enum DeclKind {
Show 22 variants Using { path: Vec<Name>, global: bool, statics: bool, }, Namespace { path: Vec<Name>, body: Option<Vec<Decl>>, }, Alias { name: Name, ty: Type, }, Mod { name: Name, body: Vec<Decl>, }, Event { ty: Type, name: Name, }, Method(Method), Field(Field), Property { ty: Type, name: Name, accessors: Vec<Accessor>, value: Option<Expr>, }, Ctor(Ctor), Type { word: Name, name: Name, value: bool, header: TypeHeader, body: Vec<Decl>, }, Enum { name: Name, generics: Vec<Generic>, base: Option<Type>, variants: Vec<Variant>, body: Vec<Decl>, }, Unit { name: Name, value: Option<Expr>, }, Content { kind: Name, name: Name, header: TypeHeader, body: Vec<Decl>, }, Component { name: Name, header: TypeHeader, body: Vec<Decl>, }, System { name: Name, params: Vec<Param>, every: Option<Expr>, body: Block, }, Extend { ty: Type, header: TypeHeader, body: Vec<Decl>, }, Prop(Prop), Screen { name: Name, header: TypeHeader, ui: String, body: Vec<Decl>, }, Command { name: String, body: Vec<Decl>, }, Test { name: String, body: Block, }, Patch(Patch), Targets(VersionCond),
}

Variants§

§

Using

using Yog.Ui;, using static Yog.Chat;, global using …;.

Fields

§path: Vec<Name>
§global: bool
§statics: bool
§

Namespace

namespace A.B; (the rest of the file: body None) or namespace A.B { … }.

Fields

§path: Vec<Name>
§body: Option<Vec<Decl>>
§

Alias

using Grid = Dictionary<Pos, i32>;.

Fields

§name: Name
§ty: Type
§

Mod

mod Charge { Version = "1.0.0"; … }: its properties, and members — its constructor runs when the mod loads.

Fields

§name: Name
§body: Vec<Decl>
§

Event

public event Action<Player> Joined;.

Fields

§ty: Type
§name: Name
§

Method(Method)

§

Field(Field)

§

Property

Ticks Left { get; set; }, Energy Room => …;.

Fields

§ty: Type
§name: Name
§accessors: Vec<Accessor>
§value: Option<Expr>
§

Ctor(Ctor)

§

Type

class, struct, record, interface: which is word; value: copied by value (a struct, a record struct).

Fields

§word: Name
§name: Name
§value: bool
§header: TypeHeader
§body: Vec<Decl>
§

Enum

enum Mode { Idle, Charging(i32 Rate) }, enum Tier : u8 { Wood = 1 }.

Fields

§name: Name
§generics: Vec<Generic>
§base: Option<Type>
§variants: Vec<Variant>
§body: Vec<Decl>
§

Unit

unit Energy; / unit FE = Energy * 1;.

Fields

§name: Name
§value: Option<Expr>
§

Content

block Charger has Charge(1000) { … }, recipe Battery : Shaped { … }, a mod’s own kinds.

Fields

§kind: Name
§name: Name
§header: TypeHeader
§body: Vec<Decl>
§

Component

Fields

§name: Name
§header: TypeHeader
§body: Vec<Decl>
§

System

server system Solar(Charge charge, Block block) every 1t { … }.

Fields

§name: Name
§params: Vec<Param>
§every: Option<Expr>
§body: Block
§

Extend

Fields

§ty: Type
§header: TypeHeader
§body: Vec<Decl>
§

Prop(Prop)

Hardness = 2.0f; in a content or mod body.

§

Screen

Fields

§name: Name
§header: TypeHeader
§body: Vec<Decl>
§

Command

Fields

§name: String
§body: Vec<Decl>
§

Test

Fields

§name: String
§body: Block
§

Patch(Patch)

§

Targets(VersionCond)

targets mc 1.20.1..26.2;: the game versions a .yns is for.

Implementations§

Source§

impl DeclKind

Source

pub fn members(&self) -> &[Decl]

The declarations inside this one: a type’s, a mod’s, a namespace’s members.

Trait Implementations§

Source§

impl Clone for DeclKind

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DeclKind

Source§

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

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

impl PartialEq for DeclKind

Source§

fn eq(&self, other: &Self) -> 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 DeclKind

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> Arg<T> for T

Source§

fn arg(self) -> T

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.