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: StringTrait Implementations§
Source§impl Violation for IOError
E902
impl Violation for IOError
E902
Source§fn message_formats() -> &'static [&'static str]
fn message_formats() -> &'static [&'static str]
Returns the format strings used by
message.Source§const FIX_AVAILABILITY: FixAvailability = FixAvailability::None
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>
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
fn into_diagnostic(self, range: TextRange, file: &SourceFile) -> Diagnostic
Convert the violation into a
Diagnostic.Auto Trait Implementations§
impl Freeze for IOError
impl RefUnwindSafe for IOError
impl Send for IOError
impl Sync for IOError
impl Unpin for IOError
impl UnsafeUnpin for IOError
impl UnwindSafe for IOError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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