pub enum Error {
NotImplemented(String),
Invalid(String),
Io(String),
Cancelled,
Coded(&'static str, Box<Error>),
}Variants§
NotImplemented(String)
対応していない機能を含む
Invalid(String)
値や構成が不正
Io(String)
ファイルの読込
Cancelled
計算を途中でやめた(crate::par::CancelToken::cancel、GUI で系が変わったとき)
Coded(&'static str, Box<Error>)
機械で見分ける符号(code の定数)を付けた誤り(Error::with_code。種類・文は中の誤りのもの)
Implementations§
Source§impl Error
impl Error
Sourcepub fn kind(&self) -> &'static str
pub fn kind(&self) -> &'static str
種類の名前(serve の誤りの data.kind・Python の例外のクラスに使う): not_implemented・invalid・io・cancelled
Sourcepub fn code(&self) -> &'static str
pub fn code(&self) -> &'static str
機械で見分ける符号(code の定数。符号を付けていなければ種類の名前 Error::kind)
Sourcepub fn message(&self) -> Option<&str>
pub fn message(&self) -> Option<&str>
符号のない文の誤り(Error::Invalid・Error::Io・Error::NotImplemented)の文(中断は None)
Trait Implementations§
Source§impl Display for Error
表示の文(crate::i18n: 英語の元の文、日本語の表示なら表で訳す)
impl Display for Error
表示の文(crate::i18n: 英語の元の文、日本語の表示なら表で訳す)
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Error> for Error
入出力の誤り(種類 io。ファイルが無い・フォルダのときは符号 code::FILE_NOT_FOUND・code::IS_FOLDER も)
impl From<Error> for Error
入出力の誤り(種類 io。ファイルが無い・フォルダのときは符号 code::FILE_NOT_FOUND・code::IS_FOLDER も)
Source§impl From<Error> for String
誤りを文字列にする(Result<_, String> を返す関数の中で ? で呼べる。種類・符号は消えるので、新しいコードは
Error のまま返す)。文字列の誤りは表示する所で訳す約束なので、ここでは訳さない(英語の元の文)。
不正(Error::Invalid)は前置きなしの文、ほかは英語の種類の前置きつき(From<String> で種類に戻る)
impl From<Error> for String
誤りを文字列にする(Result<_, String> を返す関数の中で ? で呼べる。種類・符号は消えるので、新しいコードは
Error のまま返す)。文字列の誤りは表示する所で訳す約束なので、ここでは訳さない(英語の元の文)。
不正(Error::Invalid)は前置きなしの文、ほかは英語の種類の前置きつき(From<String> で種類に戻る)
Source§impl From<String> for Error
文字列の誤り(種類の前置きがあればその種類、無ければ Error::Invalid)。Result<_, String> を返す関数を ? で呼べる
impl From<String> for Error
文字列の誤り(種類の前置きがあればその種類、無ければ Error::Invalid)。Result<_, String> を返す関数を ? で呼べる
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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