pub struct CowExpression { /* private fields */ }
Expand description
写时复制表达式包装器
Implementations§
Source§impl CowExpression
impl CowExpression
Sourcepub fn new(expr: Expression) -> Self
pub fn new(expr: Expression) -> Self
创建新的写时复制表达式
从共享表达式创建
Sourcepub fn as_ref(&self) -> &Expression
pub fn as_ref(&self) -> &Expression
获取表达式的引用
Sourcepub fn as_mut(&mut self) -> &mut Expression
pub fn as_mut(&mut self) -> &mut Expression
获取可变引用(触发写时复制)
Sourcepub fn is_modified(&self) -> bool
pub fn is_modified(&self) -> bool
检查是否已修改
Sourcepub fn into_owned(self) -> Expression
pub fn into_owned(self) -> Expression
转换为拥有的表达式
转换为共享表达式
Trait Implementations§
Source§impl Clone for CowExpression
impl Clone for CowExpression
Source§fn clone(&self) -> CowExpression
fn clone(&self) -> CowExpression
Returns a duplicate of the value. Read more
1.0.0 · 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 CowExpression
impl Debug for CowExpression
Source§impl PartialEq for CowExpression
impl PartialEq for CowExpression
Auto Trait Implementations§
impl Freeze for CowExpression
impl RefUnwindSafe for CowExpression
impl !Send for CowExpression
impl !Sync for CowExpression
impl Unpin for CowExpression
impl UnwindSafe for CowExpression
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