pub enum CliError {
Show 22 variants
Io(Error),
FileExists(String),
Clap(String),
Generation(String),
Migration(String),
Cache(String),
Scheduler(String),
Generic(String),
InvalidPluginName(String),
UnknownTemplate {
requested: String,
available: Vec<String>,
},
FieldParseError(String),
DirExists(PathBuf),
TemplateMissing(Vec<String>),
TemplateSyntaxError {
file: String,
line: usize,
col: usize,
msg: String,
},
VarNotFound {
var: String,
file: String,
line: usize,
},
CompileFailed(Vec<String>),
ForeignKeyNotFound(String),
MasterSlaveSame,
Marketplace(String),
Http(String),
Toml(String),
Json(String),
}Expand description
CLI 错误
Variants§
Io(Error)
文件 IO 错误(创建文件、读取模板等)
FileExists(String)
文件已存在(对齐 PHP Make::execute 中 already exists! 提示)
Clap(String)
clap 参数解析错误(对齐 PHP console\Input 验证失败)
Generation(String)
代码生成错误(模板替换失败等)
Migration(String)
数据库迁移错误
Cache(String)
缓存清理错误
Scheduler(String)
调度器错误
Generic(String)
通用错误
InvalidPluginName(String)
P1-T3: 非法插件名称(不符合 Rust crate 命名规范)
UnknownTemplate
P1-T3: 未知模板类型(附带用户请求的模板名与可用模板列表)
FieldParseError(String)
P1-T3: 字段定义解析错误
DirExists(PathBuf)
P1-T3: 目标目录已存在(需 –force 覆盖)
TemplateMissing(Vec<String>)
P1-T3: 模板文件缺失(附带缺失文件列表)
TemplateSyntaxError
P1-T3: 模板语法错误(含文件名/行号/列号/错误消息)
VarNotFound
P1-T3: 模板变量未找到(含变量名/引用文件/行号)
CompileFailed(Vec<String>)
P1-T3: cargo check 编译失败(含编译错误列表)
ForeignKeyNotFound(String)
P1-T3: 外键字段不存在于从表字段定义中
MasterSlaveSame
P1-T3: 主表与从表同名
Marketplace(String)
P2-2: 插件市场错误
Http(String)
P2-2: HTTP 请求错误
Toml(String)
P2-2: TOML 序列化错误
Json(String)
P2-2: JSON 序列化错误
Trait Implementations§
Source§impl Error for CliError
impl Error for CliError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for CliError
impl !UnwindSafe for CliError
impl Freeze for CliError
impl Send for CliError
impl Sync for CliError
impl Unpin for CliError
impl UnsafeUnpin for CliError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.