Skip to main content

Mutator

Struct Mutator 

Source
pub struct Mutator<S: SyncState, R: Runtime = Wry> { /* private fields */ }

Implementations§

Source§

impl<S: SyncState, R: Runtime> Mutator<S, R>

Source

pub fn current(&self) -> &S

Source

pub fn reload(&mut self) -> Result<&S, Error>

Source

pub fn mutate(&mut self, f: impl FnOnce(&mut S))

Source

pub fn try_mutate(&mut self, f: impl FnOnce(&mut S)) -> Result<(), Error>

Source

pub async fn mutate_async<F, Fut>(&mut self, f: F)
where F: FnOnce(S) -> Fut, Fut: Future<Output = S>,

Source

pub async fn try_mutate_async<F, Fut>(&mut self, f: F) -> Result<(), Error>
where F: FnOnce(S) -> Fut, Fut: Future<Output = S>,

Trait Implementations§

Source§

impl<'de, S: SyncState, R: Runtime> CommandArg<'de, R> for Mutator<S, R>

Source§

fn from_command(command: CommandItem<'de, R>) -> Result<Self, InvokeError>

Derives an instance of Self from the CommandItem. Read more
Source§

impl<S: SyncState, R: Runtime> Deref for Mutator<S, R>

Source§

type Target = S

The resulting type after dereferencing.
Source§

fn deref(&self) -> &S

Dereferences the value.

Auto Trait Implementations§

§

impl<S, R = Wry<EventLoopMessage>> !RefUnwindSafe for Mutator<S, R>

§

impl<S, R = Wry<EventLoopMessage>> !UnwindSafe for Mutator<S, R>

§

impl<S, R> Freeze for Mutator<S, R>

§

impl<S, R> Send for Mutator<S, R>

§

impl<S, R> Sync for Mutator<S, R>

§

impl<S, R> Unpin for Mutator<S, R>

§

impl<S, R> UnsafeUnpin for Mutator<S, R>

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> Formattable for T
where T: Deref, <T as Deref>::Target: Formattable,

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> Parsable for T
where T: Deref, <T as Deref>::Target: Parsable,

Source§

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

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.