Skip to main content

FileIsTextRule

Struct FileIsTextRule 

Source
pub struct FileIsTextRule { /* private fields */ }

Trait Implementations§

Source§

impl Debug for FileIsTextRule

Source§

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

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

impl Rule for FileIsTextRule

Source§

fn id(&self) -> &str

Source§

fn level(&self) -> Level

Source§

fn policy_url(&self) -> Option<&str>

Source§

fn evaluate(&self, ctx: &Context<'_>) -> Result<Vec<Violation>>

Source§

fn wants_git_tracked(&self) -> bool

Whether this rule needs the git-tracked-paths set on Context. Default false; rule kinds that support git_tracked_only override to return true only when the user actually opted in. The engine collects the set (via git ls-files) once per run when ANY rule returns true, so the cost is paid at most once even if many rules opt in.
Source§

fn requires_full_index(&self) -> bool

In --changed mode, return true to evaluate this rule against the full FileIndex rather than the changed-only filtered subset. Default false (per-file semantics — the rule sees only changed files in scope). Read more
Source§

fn path_scope(&self) -> Option<&Scope>

In --changed mode, return the Scope this rule is scoped to (typically the rule’s paths: field). The engine intersects the scope with the changed-set; rules whose scope doesn’t intersect are skipped, which is the optimisation --changed exists for. Read more
Source§

fn fixer(&self) -> Option<&dyn Fixer>

Optional automatic-fix strategy. Rules whose violations can be mechanically corrected (e.g. creating a missing file, removing a forbidden one, renaming to the correct case) return a Fixer here; the default implementation reports the rule as unfixable.

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, 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> Same for T

Source§

type Output = T

Should always be Self
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.