Skip to main content

DeclarationGroup

Enum DeclarationGroup 

Source
pub enum DeclarationGroup {
Show 14 variants Tools, ClassNames, Extends, Docstrings, Signals, Enums, Consts, StaticVars, Exports, PubVars, PrvVars, OnreadyPubVars, OnreadyPrvVars, Others,
}
Expand description

The groups a project may put in an order of its own.

This is gdtoolkit’s vocabulary rather than gdck’s, deliberately: it exists so a project that pinned class-definitions-order in a gdlintrc keeps the order it chose. gdck sorts more finely than these fourteen names can express — it knows _ready() from _process() from a static function, where gdtoolkit has only others — and that finer order is kept within whichever position Others is given.

Variants§

§

Tools

§

ClassNames

§

Extends

§

Docstrings

§

Signals

§

Enums

§

Consts

§

StaticVars

§

Exports

§

PubVars

§

PrvVars

§

OnreadyPubVars

§

OnreadyPrvVars

§

Others

Implementations§

Source§

impl DeclarationGroup

Source

pub const GUIDE_ORDER: [Self; 14]

The order the style guide gives, which is what code-order checks unless a project names one of its own.

Nothing reads the variants’ declaration order — there is no Ord here and no cast to an integer — so this is the single place that says what the default order is. It had been implicit in the Bucket enum over in the linter, which left nothing to print and nothing to check a document against, and the documented example drifted out of step as a result: it showed staticvars last, where the guide puts it eighth, directly after constants.

Source

pub fn name(self) -> &'static str

The gdtoolkit spelling, which is also gdck’s.

Source

pub fn from_name(name: &str) -> Option<Self>

Read one from the name gdtoolkit uses for it.

Trait Implementations§

Source§

impl Clone for DeclarationGroup

Source§

fn clone(&self) -> DeclarationGroup

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 Copy for DeclarationGroup

Source§

impl Debug for DeclarationGroup

Source§

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

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

impl Eq for DeclarationGroup

Source§

impl PartialEq for DeclarationGroup

Source§

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

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> 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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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 = 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<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.