Movatterモバイル変換


[0]ホーム

URL:


RwLockReadGuard

std::sync

StructRwLockReadGuard 

1.0.0 ·Source
pub struct RwLockReadGuard<'rwlock, T: ?Sized + 'rwlock> {/* private fields */ }
Expand description

RAII structure used to release the shared read access of a lock whendropped.

This structure is created by theread andtry_read methods onRwLock.

Implementations§

Source§

impl<'rwlock, T: ?Sized>RwLockReadGuard<'rwlock, T>

Source

pub fnmap<U, F>(orig: Self, f: F) ->MappedRwLockReadGuard<'rwlock, U>
where F:FnOnce(&T) ->&U, U: ?Sized,

🔬This is a nightly-only experimental API. (mapped_lock_guards #117108)

Makes aMappedRwLockReadGuard for a component of the borrowed data, e.g.an enum variant.

TheRwLock is already locked for reading, so this cannot fail.

This is an associated function that needs to be used asRwLockReadGuard::map(...). A method would interfere with methods ofthe same name on the contents of theRwLockReadGuard used throughDeref.

§Panics

If the closure panics, the guard will be dropped (unlocked) and the RwLock will not bepoisoned.

Source

pub fnfilter_map<U, F>( orig: Self, f: F,) ->Result<MappedRwLockReadGuard<'rwlock, U>, Self>
where F:FnOnce(&T) ->Option<&U>, U: ?Sized,

🔬This is a nightly-only experimental API. (mapped_lock_guards #117108)

Makes aMappedRwLockReadGuard for a component of the borrowed data. Theoriginal guard is returned as anErr(...) if the closure returnsNone.

TheRwLock is already locked for reading, so this cannot fail.

This is an associated function that needs to be used asRwLockReadGuard::filter_map(...). A method would interfere with methodsof the same name on the contents of theRwLockReadGuard used throughDeref.

§Panics

If the closure panics, the guard will be dropped (unlocked) and the RwLock will not bepoisoned.

Trait Implementations§

1.16.0 ·Source§

impl<T: ?Sized +Debug>Debug forRwLockReadGuard<'_, T>

Source§

fnfmt(&self, f: &mutFormatter<'_>) ->Result

Formats the value using the given formatter.Read more
1.0.0 ·Source§

impl<T: ?Sized>Deref forRwLockReadGuard<'_, T>

Source§

typeTarget = T

The resulting type after dereferencing.
Source§

fnderef(&self) ->&T

Dereferences the value.
1.20.0 ·Source§

impl<T: ?Sized +Display>Display forRwLockReadGuard<'_, T>

Source§

fnfmt(&self, f: &mutFormatter<'_>) ->Result

Formats the value using the given formatter.Read more
1.0.0 ·Source§

impl<T: ?Sized>Drop forRwLockReadGuard<'_, T>

Source§

fndrop(&mut self)

Executes the destructor for this type.Read more
1.0.0 ·Source§

impl<T: ?Sized> !Send forRwLockReadGuard<'_, T>

1.23.0 ·Source§

impl<T: ?Sized +Sync>Sync forRwLockReadGuard<'_, T>

Auto Trait Implementations§

§

impl<'rwlock, T>Freeze forRwLockReadGuard<'rwlock, T>
where T: ?Sized,

§

impl<'rwlock, T>RefUnwindSafe forRwLockReadGuard<'rwlock, T>
where T:RefUnwindSafe + ?Sized,

§

impl<'rwlock, T>Unpin forRwLockReadGuard<'rwlock, T>
where T: ?Sized,

§

impl<'rwlock, T>UnwindSafe forRwLockReadGuard<'rwlock, T>
where T:RefUnwindSafe + ?Sized,

Blanket Implementations§

Source§

impl<T>Any for T
where T: 'static + ?Sized,

Source§

fntype_id(&self) ->TypeId

Gets theTypeId ofself.Read more
Source§

impl<T>Borrow<T> for T
where T: ?Sized,

Source§

fnborrow(&self) ->&T

Immutably borrows from an owned value.Read more
Source§

impl<T>BorrowMut<T> for T
where T: ?Sized,

Source§

fnborrow_mut(&mut self) ->&mut T

Mutably borrows from an owned value.Read more
Source§

impl<T>From<T> for T

Source§

fnfrom(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U>Into<U> for T
where U:From<T>,

Source§

fninto(self) -> U

CallsU::from(self).

That is, this conversion is whatever the implementation ofFrom<T> for U chooses to do.

Source§

impl<P, T>Receiver for P
where P:Deref<Target = T> + ?Sized, T: ?Sized,

Source§

typeTarget = T

🔬This is a nightly-only experimental API. (arbitrary_self_types #44874)
The target type on which the method may be called.
Source§

impl<T>ToString for T
where T:Display + ?Sized,

Source§

fnto_string(&self) ->String

Converts the given value to aString.Read more
Source§

impl<T, U>TryFrom<U> for T
where U:Into<T>,

Source§

typeError =Infallible

The type returned in the event of a conversion error.
Source§

fntry_from(value: U) ->Result<T, <T asTryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U>TryInto<U> for T
where U:TryFrom<T>,

Source§

typeError = <U asTryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fntry_into(self) ->Result<U, <U asTryFrom<T>>::Error>

Performs the conversion.

[8]ページ先頭

©2009-2026 Movatter.jp