pub enum MakeCommand {
Model {
name: String,
},
Controller {
name: String,
api: bool,
plain: bool,
},
Migration {
name: String,
path: String,
},
Seeder {
name: String,
path: String,
},
Guard {
name: String,
},
Validate {
name: String,
},
Event {
name: String,
},
Listener {
name: String,
event: Option<String>,
},
Command {
name: String,
},
Service {
name: String,
},
Middleware {
name: String,
},
Scaffold {
name: String,
},
}Expand description
make 子命令枚举
对齐 PHP think make:* 命令组。
Variants§
Model
生成 Model(对齐 php think make:model User)
Controller
生成 Controller(对齐 php think make:controller User)
Migration
生成迁移文件(对齐 Phinx make:migration)
Seeder
生成填充文件(对齐 PHP make:seeder)
在 seeds/ 目录下生成 <name>.sql 文件骨架。
Guard
生成 Guard(sz-rust 自研,无 PHP 对应)
Validate
生成验证器(对齐 PHP make:validate)
在 app/validate/ 目录下生成 <Name>.rs 验证器骨架。
Event
生成事件类(对齐 PHP make:event)
在 app/event/ 目录下生成 <Name>.rs 事件骨架,包含事件名与负载构造方法。
Listener
生成监听器(对齐 PHP make:listener)
在 app/listener/ 目录下生成 <Name>.rs 监听器骨架,实现 Listener trait。
Command
生成自定义命令(对齐 PHP make:command)
在 app/command/ 目录下生成 <Name>.rs 命令骨架,实现 Command trait。
Service
生成服务类(对齐 PHP make:service)
在 app/service/ 目录下生成 <Name>.rs 服务骨架,可注入容器。
Middleware
生成中间件(sz-rust 自研,对齐 NestJS make:middleware)
在 app/middleware/ 目录下生成 <Name>.rs 中间件骨架,
实现 SzMiddleware trait,可注册到中间件链。
Scaffold
生成脚手架(Model + Controller + Migration)
Trait Implementations§
Source§impl Debug for MakeCommand
impl Debug for MakeCommand
Source§impl FromArgMatches for MakeCommand
impl FromArgMatches for MakeCommand
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for MakeCommand
impl Subcommand for MakeCommand
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommandAuto Trait Implementations§
impl Freeze for MakeCommand
impl RefUnwindSafe for MakeCommand
impl Send for MakeCommand
impl Sync for MakeCommand
impl Unpin for MakeCommand
impl UnsafeUnpin for MakeCommand
impl UnwindSafe for MakeCommand
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
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> ⓘ
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> ⓘ
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
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.