pub struct AppendState { /* private fields */ }Expand description
动态 Append 状态 — 对齐 PHP $this->append 实例属性
PHP 中 $append 是实例属性,可通过 append() 方法动态修改:
append($fields)默认覆盖(Conversion.php第 90-94 行)append($fields, true)合并(Conversion.php第 91-93 行)
Rust 中通过 AppendState 持有动态状态,None 表示使用静态 BaseModel::append()。
§鲜视达项目实际用法
项目内 12 个模型使用静态 $append 声明,零动态 ->append() 调用。
此结构提供框架能力补全,业务模型按需使用。
Implementations§
Source§impl AppendState
impl AppendState
Trait Implementations§
Source§impl Clone for AppendState
impl Clone for AppendState
Source§fn clone(&self) -> AppendState
fn clone(&self) -> AppendState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AppendState
impl Debug for AppendState
Source§impl Default for AppendState
impl Default for AppendState
Source§fn default() -> AppendState
fn default() -> AppendState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AppendState
impl RefUnwindSafe for AppendState
impl Send for AppendState
impl Sync for AppendState
impl Unpin for AppendState
impl UnsafeUnpin for AppendState
impl UnwindSafe for AppendState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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