WritableKeyPath

Struct WritableKeyPath 

Source
pub struct WritableKeyPath<Root, Value, F>
where F: for<'r> Fn(&'r mut Root) -> &'r mut Value,
{ /* private fields */ }

Implementations§

Source§

impl<Root, Value, F> WritableKeyPath<Root, Value, F>
where F: for<'r> Fn(&'r mut Root) -> &'r mut Value,

Source

pub fn new(getter: F) -> Self

Source

pub fn get_mut<'r>(&self, root: &'r mut Root) -> &'r mut Value

Source

pub fn to_optional( self, ) -> WritableOptionalKeyPath<Root, Value, impl for<'r> Fn(&'r mut Root) -> Option<&'r mut Value> + 'static>
where F: 'static,

Convert a WritableKeyPath to WritableOptionalKeyPath for chaining This allows non-optional writable keypaths to be chained with then()

Source

pub fn for_box<Target>( self, ) -> WritableKeyPath<Root, Target, impl for<'r> Fn(&'r mut Root) -> &'r mut Target + 'static>
where Value: DerefMut<Target = Target> + 'static, F: 'static,

Source

pub fn for_arc<Target>( self, ) -> WritableKeyPath<Root, Target, impl for<'r> Fn(&'r mut Root) -> &'r mut Target + 'static>
where Value: DerefMut<Target = Target> + 'static, F: 'static,

Source

pub fn for_rc<Target>( self, ) -> WritableKeyPath<Root, Target, impl for<'r> Fn(&'r mut Root) -> &'r mut Target + 'static>
where Value: DerefMut<Target = Target> + 'static, F: 'static,

Source§

impl<Root, Value, F> WritableKeyPath<Root, Value, F>
where F: for<'r> Fn(&'r mut Root) -> &'r mut Value + 'static, Root: 'static, Value: Any + 'static,

Source

pub fn to_partial(self) -> PartialWritableKeyPath<Root>

Convert to PartialWritableKeyPath (hides Value type)

Source

pub fn to(self) -> PartialWritableKeyPath<Root>

Alias for to_partial() - converts to PartialWritableKeyPath

Trait Implementations§

Source§

impl<Root: Clone, Value: Clone, F> Clone for WritableKeyPath<Root, Value, F>
where F: for<'r> Fn(&'r mut Root) -> &'r mut Value + Clone,

Source§

fn clone(&self) -> WritableKeyPath<Root, Value, F>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<Root, Value, F> Freeze for WritableKeyPath<Root, Value, F>
where F: Freeze,

§

impl<Root, Value, F> RefUnwindSafe for WritableKeyPath<Root, Value, F>
where F: RefUnwindSafe, Root: RefUnwindSafe, Value: RefUnwindSafe,

§

impl<Root, Value, F> Send for WritableKeyPath<Root, Value, F>
where F: Send, Root: Send, Value: Send,

§

impl<Root, Value, F> Sync for WritableKeyPath<Root, Value, F>
where F: Sync, Root: Sync, Value: Sync,

§

impl<Root, Value, F> Unpin for WritableKeyPath<Root, Value, F>
where F: Unpin, Root: Unpin, Value: Unpin,

§

impl<Root, Value, F> UnwindSafe for WritableKeyPath<Root, Value, F>
where F: UnwindSafe, Root: UnwindSafe, Value: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.