pub struct OperationScope<'a> { /* private fields */ }Implementations§
Source§impl<'a> OperationScope<'a>
impl<'a> OperationScope<'a>
Sourcepub fn mark_success(&mut self)
pub fn mark_success(&mut self)
显式标记成功
Sourcepub fn mark_failure(&mut self)
pub fn mark_failure(&mut self)
保持失败状态(默认行为)
Methods from Deref<Target = OperationContext>§
pub fn with<S1: Into<String>, S2: Into<String>>(&mut self, key: S1, val: S2)
👎Deprecated since 0.5.4: use record
pub fn with_path<S1: Into<String>, S2: Into<PathBuf>>( &mut self, key: S1, val: S2, )
👎Deprecated since 0.5.4: use record
pub fn with_want<S: Into<String>>(&mut self, target: S)
Sourcepub fn set_target<S: Into<String>>(&mut self, target: S)
pub fn set_target<S: Into<String>>(&mut self, target: S)
别名:设置目标资源/操作名,与 with_want 等效
pub fn mark_suc(&mut self)
pub fn mark_cancel(&mut self)
Sourcepub fn scope(&mut self) -> OperationScope<'_>
pub fn scope(&mut self) -> OperationScope<'_>
创建作用域 guard,默认为失败状态,需显式 mark_success()
Sourcepub fn scoped_success(&mut self) -> OperationScope<'_>
pub fn scoped_success(&mut self) -> OperationScope<'_>
创建作用域 guard,在作用域结束时自动标记成功
pub fn debug<S: AsRef<str>>(&self, message: S)
pub fn warn<S: AsRef<str>>(&self, message: S)
pub fn error<S: AsRef<str>>(&self, message: S)
pub fn trace<S: AsRef<str>>(&self, message: S)
pub fn log_debug<S: AsRef<str>>(&self, message: S)
pub fn log_warn<S: AsRef<str>>(&self, message: S)
pub fn log_error<S: AsRef<str>>(&self, message: S)
pub fn log_trace<S: AsRef<str>>(&self, message: S)
Trait Implementations§
Source§impl<'a> Deref for OperationScope<'a>
impl<'a> Deref for OperationScope<'a>
Source§impl<'a> DerefMut for OperationScope<'a>
impl<'a> DerefMut for OperationScope<'a>
Auto Trait Implementations§
impl<'a> Freeze for OperationScope<'a>
impl<'a> RefUnwindSafe for OperationScope<'a>
impl<'a> Send for OperationScope<'a>
impl<'a> Sync for OperationScope<'a>
impl<'a> Unpin for OperationScope<'a>
impl<'a> !UnwindSafe for OperationScope<'a>
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