Skip to main content

IOError

Struct IOError 

Source
pub struct IOError {
    pub message: String,
}
Expand description

§What it does

This is not a regular diagnostic; instead, it’s raised when a file cannot be read from disk.

§Why is this bad?

An IOError indicates an error in the development setup. For example, the user may not have permissions to read a given file, or the filesystem may contain a broken symlink.

§Example

On Linux or macOS:

$ echo 'print("hello world!")' > a.py
$ chmod 000 a.py
$ ruff a.py
a.py:1:1: E902 Permission denied (os error 13)
Found 1 error.

§References

Fields§

§message: String

Trait Implementations§

Source§

impl Violation for IOError

E902

Source§

fn message(&self) -> String

The message used to describe the violation.
Source§

fn message_formats() -> &'static [&'static str]

Returns the format strings used by message.
Source§

const FIX_AVAILABILITY: FixAvailability = FixAvailability::None

None in the case a fix is never available or otherwise Some FixAvailability describing the available fix.
Source§

fn fix_title(&self) -> Option<String>

Returns the title for the fix. The message is also shown as an advice as part of the diagnostics. Read more
Source§

fn into_diagnostic(self, range: TextRange, file: &SourceFile) -> Diagnostic

Convert the violation into a Diagnostic.
Source§

impl ViolationMetadata for IOError

Source§

fn rule() -> Rule

Returns the rule for this violation
Source§

fn explain() -> Option<&'static str>

Returns an explanation of what this violation catches, why it’s bad, and what users should do instead.
Source§

fn status() -> RuleStatus

Returns the rule status for this violation.
Source§

fn file() -> &'static str

Returns the file where the violation is declared.
Source§

fn line() -> u32

Returns the 1-based line where the violation is declared.

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

Source§

fn into_owned(self) -> T

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.
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