pub struct ModelLockGuard { /* private fields */ }Expand description
RAII guard for model lock. Automatically releases the lock when dropped. Used by non-stream mode to ensure lock release even on early return or panic.
Implementations§
Source§impl ModelLockGuard
impl ModelLockGuard
Sourcepub fn new(lock: Arc<ModelStreamLock>) -> Self
pub fn new(lock: Arc<ModelStreamLock>) -> Self
Create a new guard that holds the given lock. The lock should already be acquired before creating the guard.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModelLockGuard
impl RefUnwindSafe for ModelLockGuard
impl Send for ModelLockGuard
impl Sync for ModelLockGuard
impl Unpin for ModelLockGuard
impl UnwindSafe for ModelLockGuard
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> 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