Skip to main content

TypeStyle

Struct TypeStyle 

Source
pub struct TypeStyle;

Trait Implementations§

Source§

impl Rule for TypeStyle

Source§

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

The unique identifier for this rule (e.g., “missing_implementation”)
Source§

fn description(&self) -> &'static str

Human-readable description of what this rule checks
Source§

fn category(&self) -> Category

Rule category
Source§

fn fixable(&self) -> bool

Whether this rule supports automated fixes via –fix
Source§

fn config_options(&self) -> &'static [ConfigOption]

Configuration options supported by this rule
Source§

fn check_all( &self, ast_context: &AstContext, config: &Config, violations: &mut Vec<Violation>, )

Check the AST and add violations to the provided vector Default implementation calls check_func_impl for C files, check_func_decl for headers, and check_gobject_type for all files. Override this if you need custom iteration logic beyond per-item checking
Source§

fn long_description(&self) -> Option<&'static str>

Long-form markdown documentation (optional)
Source§

fn requires_meson(&self) -> bool

Whether this rule requires meson introspection to produce results. Rules returning true silently skip when no build directory is found.
Source§

fn min_glib_version(&self) -> Option<(u32, u32)>

Minimum GLib version required by this rule. None means no version requirement (compatible with all versions).
Source§

fn requires_auto_cleanup(&self) -> bool

Whether this rule suggests g_auto* macros (disabled when msvc_compatible=true)
Source§

fn opt_in(&self) -> bool

Whether this rule is disabled by default (user must explicitly enable it)
Source§

fn opt_in_reason(&self) -> Option<&'static str>

Why this rule is opt-in (only meaningful when opt_in() returns true)
Source§

fn check_func_impl( &self, ast_context: &AstContext, config: &Config, func: &FunctionDefItem, file: &FileModel, violations: &mut Vec<Violation>, )

Check a function implementation (from C files) Override this to check function bodies and implementations
Source§

fn check_func_decl( &self, ast_context: &AstContext, config: &Config, func: &FunctionDeclItem, file: &FileModel, violations: &mut Vec<Violation>, )

Check a function declaration (from header files) Override this to check function declarations and signatures
Source§

fn check_enum( &self, ast_context: &AstContext, config: &Config, enum_info: &EnumInfo, file: &FileModel, violations: &mut Vec<Violation>, )

Check an enum definition
Source§

fn check_gobject_type( &self, ast_context: &AstContext, config: &Config, gobject_type: &GObjectType, file: &FileModel, violations: &mut Vec<Violation>, )

Check a GObject type declaration/definition Override this to check properties, signals, or other GObject-level concerns
Source§

fn check_function_renames( &self, func: &FunctionDefItem, file: &FileModel, config: &Config, violations: &mut Vec<Violation>, renames: &[FunctionRename], )

Find calls to functions listed in renames and emit violations. When to is Some, generates a fix that reformats the entire call.
Source§

fn violation( &self, file: &Path, line: usize, column: usize, message: String, ) -> Violation

Helper to create a violation with the rule name automatically filled in
Source§

fn violation_with_fix( &self, file: &Path, line: usize, column: usize, message: String, fix: Fix, ) -> Violation

Helper to create a violation with an automated fix
Source§

fn violation_with_fixes( &self, file: &Path, line: usize, column: usize, message: String, fixes: Vec<Fix>, ) -> Violation

Helper to create a violation with multiple automated fixes
Source§

fn violation_at( &self, file: &Path, location: &SourceLocation, message: String, ) -> Violation

Source§

fn violation_with_fix_at( &self, file: &Path, location: &SourceLocation, message: String, fix: Fix, ) -> Violation

Source§

fn violation_with_fixes_at( &self, file: &Path, location: &SourceLocation, message: String, fixes: Vec<Fix>, ) -> Violation

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more