pub trait PathExtGuaranteed: PathExt {
// Provided methods
fn borrow(&self) -> Ref<'_, <Self as Path>::Out> { ... }
fn borrow_mut(&self) -> BorrowMutGuard<'_, Self> { ... }
fn borrow_mut_without_notifying(&self) -> RefMut<'_, <Self as Path>::Out> { ... }
fn get(&self) -> Self::Out
where Self::Out: Clone { ... }
fn set(&self, data: Self::Out)
where Self::Out: Sized { ... }
}Expand description
Implemented for Path objects that will always be able to obtain their data piece.
Such paths are those that
- don’t go through any
enum(if the enum is in a different variant, then the data cannot be obtained) - don’t go through
VecorHashMap(the requested item might not be in the collection)
The methods in this trait are similar to the borrow methods in PathExt, but they don’t return Option because we know the data is always there.
Provided Methods§
Sourcefn borrow(&self) -> Ref<'_, <Self as Path>::Out>
fn borrow(&self) -> Ref<'_, <Self as Path>::Out>
Borrow the data at this path immutably.
See borrow_opt for more details.
Sourcefn borrow_mut(&self) -> BorrowMutGuard<'_, Self>
fn borrow_mut(&self) -> BorrowMutGuard<'_, Self>
Borrow the data at this path mutably, notifying all the relevant change listeners when the returned borrow guard is dropped.
See borrow_opt_mut for more details.
Sourcefn borrow_mut_without_notifying(&self) -> RefMut<'_, <Self as Path>::Out>
fn borrow_mut_without_notifying(&self) -> RefMut<'_, <Self as Path>::Out>
Borrow the data at this path mutably without notifying any listener.
See borrow_opt_mut_without_notifying for more details.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.