Binding

Struct Binding 

Source
pub struct Binding<T>(/* private fields */)
where
    T: 'static;
Expand description

A Binding<T> represents a mutable value of type T that can be observed.

Bindings provide a reactive way to work with values. When a binding’s value changes, it can notify watchers that have registered interest in the value.

Implementations§

Source§

impl<T> Binding<T>
where T: 'static + Clone,

Source

pub fn container(value: T) -> Binding<T>

Creates a new binding from a value by wrapping it in a container.

The container provides the reactive capabilities for the value.

Source§

impl<T> Binding<T>
where T: 'static,

Source

pub fn custom( custom: impl CustomBinding<Output = T> + Clone + 'static, ) -> Binding<T>

Creates a binding that uses a custom implementation of the CustomBinding trait.

Source

pub fn get(&self) -> T

Gets the current value of the binding.

Source

pub fn get_mut(&self) -> BindingMutGuard<'_, T>

Gets mutable access to the binding’s value through a guard.

When the guard is dropped, the binding is updated with the modified value.

Note: In rust, let _ = binding.get_mut(); DO NOT immediately drop the guard. Since it just binds to a variable named _, the guard will live until the end of the current scope. Please use *guard to modify the value in one line.

§Example
use nami::Binding;
let n = Binding::int(10);
*n.get_mut() += 5; // do not bind the guard to a let pattern...even it is `_`

Tip: For better performance when modifying container bindings, consider using the with_mut method instead.

Source

pub fn set(&self, value: T)

Sets the binding to a new value

Source

pub fn take(&self) -> T
where T: Default + Clone,

Takes the value out of the binding, replacing it with the default value.

This is equivalent to std::mem::take and notifies watchers of the change.

§Example
use nami::{binding, Binding};
let mut text: Binding<String> = binding("hello");
let taken = text.take();
assert_eq!(taken, "hello");
assert_eq!(text.get(), String::new());
Source

pub fn set_from(&self, value: impl Into<T>)

Sets the binding to a new value with automatic type conversion.

Accepts any value that implements Into<T>, providing the same ergonomic benefits as the binding() constructor.

§Examples
use nami::{binding, Binding};

let mut text: Binding<String> = binding("initial");

// Direct &str usage - no .into() or .to_string() needed
text.set_from("updated");
assert_eq!(text.get(), "updated");

let mut count: Binding<i64> = binding(0);   
count.set(42);
assert_eq!(count.get(), 42i64);
Source

pub fn with_mut<R>(&self, f: impl FnOnce(&mut T) -> R) -> R
where T: Clone,

Applies a function to mutably borrow the binding’s value.

This is more efficient than get_mut() for container bindings as it avoids unnecessary cloning. The function receives a mutable reference to the value and any changes will notify watchers when the function completes.

Source

pub fn mapping<Output, Getter, Setter>( source: &Binding<T>, getter: Getter, setter: Setter, ) -> Binding<Output>
where Getter: 'static + Clone + Fn(T) -> Output, Setter: 'static + Clone + Fn(&Binding<T>, Output),

Creates a bidirectional mapping between this binding and another type.

The getter transforms values from this binding’s type to the output type. The setter transforms values from the output type back to this binding’s type.

Source

pub fn filter( &self, filter: impl Clone + Fn(&T) -> bool + 'static, ) -> Binding<T>
where T: 'static,

Creates a binding that only allows values passing a filter function.

When attempting to set a value that doesn’t pass the filter, the operation is ignored.

Source

pub fn condition( &self, condition: impl Clone + Fn(&T) -> bool + 'static, ) -> Binding<bool>
where T: 'static,

Creates a binding that maps this binding’s value to a boolean condition.

The resulting binding is read-only and reflects whether the condition is met.

§Example
let number = nami::binding(5i32);
let is_positive = number.condition(|&n: &i32| n > 0);
assert_eq!(is_positive.get(), true);
Source

pub fn equal_to(&self, other: T) -> Binding<bool>
where T: Clone + PartialEq + 'static,

Creates a binding that tracks whether this binding’s value equals a specific value.

The resulting binding is read-only.

§Example
let text = nami::binding("hello".to_string());
let is_hello = text.equal_to("hello".to_string());
assert_eq!(is_hello.get(), true);
Source§

impl<T> Binding<T>
where T: 'static,

Source

pub fn mailbox_with_executor<E>(&self, executor: E) -> BindingMailbox<T>
where E: LocalExecutor,

Attaches this Binding to a mailbox using a provided executor.

Returns a BindingMailbox which can be cloned and used to send the binding to other tasks for mutation or observation.

Source

pub fn mailbox(&self) -> BindingMailbox<T>

Attaches this Binding to a mailbox using the default native executor.

Source§

impl<T> Binding<T>
where T: PartialOrd + 'static,

Source

pub fn range(&self, range: impl RangeBounds<T> + Clone + 'static) -> Binding<T>

Creates a binding that only allows values within a specified range.

Source

pub fn clamp(&self, range: impl RangeBounds<T> + Clone + 'static) -> Binding<T>
where T: Clone,

Creates a binding that clamps values to the specified range.

Values below the range minimum are clamped to the minimum. Values above the range maximum are clamped to the maximum.

Source§

impl<T> Binding<T>
where T: Signed,

Source

pub fn sign(&self) -> Binding<bool>

Creates a binding that tracks the sign of this binding’s value.

The resulting binding is true for positive values and false for negative values. Setting true makes the value positive, setting false makes it negative.

Tip: Zero is considered positive.

§Example
use nami::Binding;
let number = Binding::int(-10i32);
let sign = number.sign();
assert_eq!(sign.get(), false);
Source§

impl Binding<i32>

Source

pub fn int(i: i32) -> Binding<i32>

Creates a new integer binding with the given value.

§Example
let counter = nami::Binding::int(42);
assert_eq!(counter.get(), 42);
Source§

impl<T> Binding<T>
where T: Clone,

Source

pub fn append<Ele>(&self, ele: Ele)
where T: Extend<Ele>,

Appends an element to the binding’s value and notifies watchers.

The binding’s value must implement Extend for the element type.

§Example
let mut text: nami::Binding<String> = nami::binding(String::from("Hello"));
text.append(" World");
assert_eq!(text.get(), "Hello World");
Source§

impl<T> Binding<T>
where T: Add<Output = T> + Clone + 'static,

Source

pub fn add_assign(&self, other: T)

Applies the + operation to the binding’s current value and the provided value.

Source§

impl<T> Binding<T>
where T: Sub<Output = T> + Clone + 'static,

Source

pub fn sub_assign(&self, other: T)

Applies the - operation to the binding’s current value and the provided value.

Source§

impl<T> Binding<T>
where T: Mul<Output = T> + Clone + 'static,

Source

pub fn mul_assign(&self, other: T)

Applies the * operation to the binding’s current value and the provided value.

Source§

impl<T> Binding<T>
where T: Div<Output = T> + Clone + 'static,

Source

pub fn div_assign(&self, other: T)

Applies the / operation to the binding’s current value and the provided value.

Source§

impl<T> Binding<T>
where T: Rem<Output = T> + Clone + 'static,

Source

pub fn rem_assign(&self, other: T)

Applies the % operation to the binding’s current value and the provided value.

Source§

impl<T> Binding<T>
where T: BitAnd<Output = T> + Clone + 'static,

Source

pub fn bitand_assign(&self, other: T)

Applies the & operation to the binding’s current value and the provided value.

Source§

impl<T> Binding<T>
where T: BitOr<Output = T> + Clone + 'static,

Source

pub fn bitor_assign(&self, other: T)

Applies the | operation to the binding’s current value and the provided value.

Source§

impl<T> Binding<T>
where T: BitXor<Output = T> + Clone + 'static,

Source

pub fn bitxor_assign(&self, other: T)

Applies the ^ operation to the binding’s current value and the provided value.

Source§

impl<T> Binding<T>
where T: Shl<Output = T> + Clone + 'static,

Source

pub fn shl_assign(&self, other: T)

Applies the << operation to the binding’s current value and the provided value.

Source§

impl<T> Binding<T>
where T: Shr<Output = T> + Clone + 'static,

Source

pub fn shr_assign(&self, other: T)

Applies the >> operation to the binding’s current value and the provided value.

Source§

impl<T> Binding<Option<T>>

Source

pub fn unwrap_or_else( &self, default: impl Clone + Fn() -> T + 'static, ) -> Binding<T>
where T: Clone + 'static,

Creates a binding that unwraps the option or uses a default value from a closure.

When setting values on the returned binding, they are wrapped in Some.

§Example
let maybe_text = nami::binding(None::<String>);
let text = maybe_text.unwrap_or_else(|| "default".to_string());
assert_eq!(text.get(), "default");
Source

pub fn unwrap_or(&self, default: T) -> Binding<T>
where T: Clone + 'static,

Creates a binding that unwraps the option or uses a default value.

When setting values on the returned binding, they are wrapped in Some.

§Example
let maybe_number = nami::binding(None::<i32>);
let number = maybe_number.unwrap_or(42);
assert_eq!(number.get(), 42);
Source

pub fn unwrap_or_default(&self) -> Binding<T>
where T: Default + Clone + 'static,

Creates a binding that unwraps the option or uses the type’s default value.

When setting values on the returned binding, they are wrapped in Some.

§Example
let maybe_vec = nami::binding(None::<Vec<i32>>);
let vec: nami::Binding<Vec<i32>> = maybe_vec.unwrap_or_default();
assert!(vec.get().is_empty());
Source

pub fn some_equal_to(&self, equal: T) -> Binding<bool>
where T: Eq + Clone + 'static,

Creates a binding that tracks whether this option contains a specific value.

The resulting binding is true when this option contains Some(equal), and false when it contains Some(other_value) or None. Setting true on the result sets this binding to Some(equal). Setting false has no effect on the binding.

§Example
let maybe_text = nami::binding(Some("hello".to_string()));
let is_hello = maybe_text.some_equal_to("hello".to_string());
assert_eq!(is_hello.get(), true);
Source§

impl Binding<bool>

Source

pub fn bool(value: bool) -> Binding<bool>

Creates a new boolean binding with the given value.

§Example
let flag = nami::Binding::bool(true);
assert_eq!(flag.get(), true);
Source

pub fn toggle(&self)

Toggles the boolean value and notifies watchers.

True becomes false, false becomes true.

§Example
let mut flag = nami::binding(false);
flag.toggle();
assert_eq!(flag.get(), true);
Source

pub fn then<T>(&self, if_true: T) -> Binding<Option<T>>
where T: Clone + 'static,

Creates a conditional binding that returns Some(value) when true, None when false.

Setting Some(value) on the result sets this binding to true. Setting None sets this binding to false.

§Example
let is_logged_in = nami::binding(true);
let username = is_logged_in.then("alice".to_string());
assert_eq!(username.get(), Some("alice".to_string()));
Source

pub fn then_some<T>(&self, if_true: T) -> Binding<Option<T>>
where T: Clone + 'static,

Creates a conditional binding that returns Some(value) when true, None when false.

This is identical to then() but follows Rust’s Option::then_some() naming convention.

§Example
let enabled = nami::binding(false);
let button_text = enabled.then_some("Click me!".to_string());
assert_eq!(button_text.get(), None);
Source

pub fn select<T>(&self, if_true: T, if_false: T) -> Binding<T>
where T: Eq + Clone + 'static,

Creates a binding that selects between two values based on this boolean.

Returns if_true when this binding is true, if_false when false. Setting the if_true value on the result sets this binding to true. Setting the if_false value sets this binding to false.

§Example
let dark_mode = nami::binding(false);
let theme = dark_mode.select("dark".to_string(), "light".to_string());
assert_eq!(theme.get(), "light");
Source

pub fn reverse(&self) -> Binding<bool>

Creates a binding that returns the logical inverse of this boolean binding.

When this binding is true, the returned binding is false, and vice versa. Setting a value on the returned binding will set the inverse value on this binding.

§Example
let enabled = nami::binding(true);
let disabled = enabled.reverse();
assert_eq!(disabled.get(), false);
Source§

impl<T> Binding<T>
where T: Clone + Neg<Output = T> + 'static,

Source

pub fn negate(&self) -> Binding<T>

Creates a binding that produces the negated value of this binding.

Updating the derived binding will reflect the negated value back to the source.

Source§

impl<T> Binding<T>
where T: Project,

Source

pub fn project(&self) -> <T as Project>::Projected

Projects this binding into its component parts.

This method uses the Project trait implementation to decompose the binding into separate reactive bindings for each component. Changes to any projected binding will be reflected in the original binding and vice versa.

§Examples
use nami::{Binding, binding};

let tuple_binding: Binding<(i32, i32, i32)> = binding((1, 2, 3));
let (mut a, mut b, c) = tuple_binding.project();

// Modify individual projections
a.set(10);
b.set(20);

// Original binding reflects changes
assert_eq!(tuple_binding.get(), (10, 20, 3));

Trait Implementations§

Source§

impl<T, RHS> Add<RHS> for Binding<T>
where RHS: Signal, T: Add<<RHS as Signal>::Output> + Clone + 'static, <RHS as Signal>::Output: Clone,

Source§

type Output = Map<Zip<Binding<T>, RHS>, fn((T, <RHS as Signal>::Output)) -> <T as Add<<RHS as Signal>::Output>>::Output, <T as Add<<RHS as Signal>::Output>>::Output>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: RHS) -> <Binding<T> as Add<RHS>>::Output

Performs the + operation. Read more
Source§

impl<T, RHS> BitAnd<RHS> for Binding<T>
where RHS: Signal, T: BitAnd<<RHS as Signal>::Output> + Clone + 'static, <RHS as Signal>::Output: Clone,

Source§

type Output = Map<Zip<Binding<T>, RHS>, fn((T, <RHS as Signal>::Output)) -> <T as BitAnd<<RHS as Signal>::Output>>::Output, <T as BitAnd<<RHS as Signal>::Output>>::Output>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: RHS) -> <Binding<T> as BitAnd<RHS>>::Output

Performs the & operation. Read more
Source§

impl<T, RHS> BitOr<RHS> for Binding<T>
where RHS: Signal, T: BitOr<<RHS as Signal>::Output> + Clone + 'static, <RHS as Signal>::Output: Clone,

Source§

type Output = Map<Zip<Binding<T>, RHS>, fn((T, <RHS as Signal>::Output)) -> <T as BitOr<<RHS as Signal>::Output>>::Output, <T as BitOr<<RHS as Signal>::Output>>::Output>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: RHS) -> <Binding<T> as BitOr<RHS>>::Output

Performs the | operation. Read more
Source§

impl<T, RHS> BitXor<RHS> for Binding<T>
where RHS: Signal, T: BitXor<<RHS as Signal>::Output> + Clone + 'static, <RHS as Signal>::Output: Clone,

Source§

type Output = Map<Zip<Binding<T>, RHS>, fn((T, <RHS as Signal>::Output)) -> <T as BitXor<<RHS as Signal>::Output>>::Output, <T as BitXor<<RHS as Signal>::Output>>::Output>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: RHS) -> <Binding<T> as BitXor<RHS>>::Output

Performs the ^ operation. Read more
Source§

impl<T> Clone for Binding<T>

Source§

fn clone(&self) -> Binding<T>

Creates a clone of this binding.

1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T> Debug for Binding<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

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

impl<T> Default for Binding<T>
where T: Default + Clone + 'static,

Source§

fn default() -> Binding<T>

Creates a binding with the default value for type T.

Source§

impl<T, RHS> Div<RHS> for Binding<T>
where RHS: Signal, T: Div<<RHS as Signal>::Output> + Clone + 'static, <RHS as Signal>::Output: Clone,

Source§

type Output = Map<Zip<Binding<T>, RHS>, fn((T, <RHS as Signal>::Output)) -> <T as Div<<RHS as Signal>::Output>>::Output, <T as Div<<RHS as Signal>::Output>>::Output>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: RHS) -> <Binding<T> as Div<RHS>>::Output

Performs the / operation. Read more
Source§

impl<T> From<Binding<T>> for Computed<T>

Source§

fn from(val: Binding<T>) -> Computed<T>

Converts to this type from the input type.
Source§

impl<T, RHS> Mul<RHS> for Binding<T>
where RHS: Signal, T: Mul<<RHS as Signal>::Output> + Clone + 'static, <RHS as Signal>::Output: Clone,

Source§

type Output = Map<Zip<Binding<T>, RHS>, fn((T, <RHS as Signal>::Output)) -> <T as Mul<<RHS as Signal>::Output>>::Output, <T as Mul<<RHS as Signal>::Output>>::Output>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: RHS) -> <Binding<T> as Mul<RHS>>::Output

Performs the * operation. Read more
Source§

impl<T> Neg for Binding<T>
where T: Clone + Neg<Output = T> + 'static,

Source§

fn neg(self) -> <Binding<T> as Neg>::Output

Implements unary negation for bindings.

Source§

type Output = Binding<T>

The resulting type after applying the - operator.
Source§

impl Not for Binding<bool>

Source§

fn not(self) -> <Binding<bool> as Not>::Output

Implements the logical NOT operator for boolean bindings.

Source§

type Output = Binding<bool>

The resulting type after applying the ! operator.
Source§

impl<T, RHS> Rem<RHS> for Binding<T>
where RHS: Signal, T: Rem<<RHS as Signal>::Output> + Clone + 'static, <RHS as Signal>::Output: Clone,

Source§

type Output = Map<Zip<Binding<T>, RHS>, fn((T, <RHS as Signal>::Output)) -> <T as Rem<<RHS as Signal>::Output>>::Output, <T as Rem<<RHS as Signal>::Output>>::Output>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: RHS) -> <Binding<T> as Rem<RHS>>::Output

Performs the % operation. Read more
Source§

impl<T, RHS> Shl<RHS> for Binding<T>
where RHS: Signal, T: Shl<<RHS as Signal>::Output> + Clone + 'static, <RHS as Signal>::Output: Clone,

Source§

type Output = Map<Zip<Binding<T>, RHS>, fn((T, <RHS as Signal>::Output)) -> <T as Shl<<RHS as Signal>::Output>>::Output, <T as Shl<<RHS as Signal>::Output>>::Output>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: RHS) -> <Binding<T> as Shl<RHS>>::Output

Performs the << operation. Read more
Source§

impl<T, RHS> Shr<RHS> for Binding<T>
where RHS: Signal, T: Shr<<RHS as Signal>::Output> + Clone + 'static, <RHS as Signal>::Output: Clone,

Source§

type Output = Map<Zip<Binding<T>, RHS>, fn((T, <RHS as Signal>::Output)) -> <T as Shr<<RHS as Signal>::Output>>::Output, <T as Shr<<RHS as Signal>::Output>>::Output>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: RHS) -> <Binding<T> as Shr<RHS>>::Output

Performs the >> operation. Read more
Source§

impl<T> Signal for Binding<T>
where T: 'static,

Source§

fn get(&self) -> <Binding<T> as Signal>::Output

Computes the current value of the binding.

Source§

fn watch( &self, watcher: impl Fn(Context<<Binding<T> as Signal>::Output>) + 'static, ) -> <Binding<T> as Signal>::Guard

Registers a watcher to be notified when the binding’s value changes.

Source§

type Output = T

The type of value produced by this computation.
Source§

type Guard = Box<dyn WatcherGuard>

The guard type returned by the watch method that manages watcher lifecycle.
Source§

impl<T, RHS> Sub<RHS> for Binding<T>
where RHS: Signal, T: Sub<<RHS as Signal>::Output> + Clone + 'static, <RHS as Signal>::Output: Clone,

Source§

type Output = Map<Zip<Binding<T>, RHS>, fn((T, <RHS as Signal>::Output)) -> <T as Sub<<RHS as Signal>::Output>>::Output, <T as Sub<<RHS as Signal>::Output>>::Output>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: RHS) -> <Binding<T> as Sub<RHS>>::Output

Performs the - operation. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Binding<T>

§

impl<T> !RefUnwindSafe for Binding<T>

§

impl<T> !Send for Binding<T>

§

impl<T> !Sync for Binding<T>

§

impl<T> Unpin for Binding<T>

§

impl<T> !UnwindSafe for Binding<T>

Blanket Implementations§

Source§

impl<S> AnimationExt for S
where S: SignalExt,

Source§

fn animated(self) -> WithMetadata<Self, Animation>
where Self: Sized,

Apply default animation to this reactive value Read more
Source§

fn with_animation(self, animation: Animation) -> WithMetadata<Self, Animation>
where Self: Sized,

Apply a specific animation to this reactive value Read more
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<C, F, T1, T2, Output> FlattenMap<F, (T1, T2), Output> for C
where C: Signal<Output = (T1, T2)> + 'static, F: 'static + Clone + Fn(T1, T2) -> Output, T1: 'static, T2: 'static, Output: 'static,

Source§

fn flatten_map(self, f: F) -> Map<C, impl Clone + Fn((T1, T2)), Output>

Maps a function over the flattened elements of a nested tuple. Read more
Source§

impl<C, F, T1, T2, T3, Output> FlattenMap<F, (T1, T2, T3), Output> for C
where C: Signal<Output = ((T1, T2), T3)> + 'static, F: 'static + Clone + Fn(T1, T2, T3) -> Output, Output: 'static,

Source§

fn flatten_map(self, f: F) -> Map<C, impl Clone + Fn(((T1, T2), T3)), Output>

Maps a function over the flattened elements of a nested tuple. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> IdentifiableExt for T

Source§

fn use_id<F, Id>(self, f: F) -> UseId<Self, F>
where F: Fn(&Self) -> Id, Id: Ord + Hash,

Wraps the value in a UseId with the provided identification function.
Source§

fn self_id(self) -> SelfId<Self>

Wraps the value in a SelfId, making the value serve as its own identifier.
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<C> SignalExt for C
where C: Signal,

Source§

fn map<F, Output>(self, f: F) -> Map<Self, F, Output>
where F: 'static + Clone + Fn(Self::Output) -> Output, Output: 'static, Self: 'static,

Transforms the output of this signal using the provided function.
Source§

fn zip<B>(self, b: B) -> Zip<Self, B>
where B: Signal, Self::Output: Clone, <B as Signal>::Output: Clone,

Combines this signal with another signal into a tuple.
Source§

fn cached(self) -> Cached<Self>
where Self::Output: Clone,

Wraps this signal with caching to avoid redundant computations.
Source§

fn computed(self) -> Computed<Self::Output>
where Self: 'static,

Converts this signal into a type-erased Computed container.
Source§

fn with<T>(self, metadata: T) -> WithMetadata<Self, T>

Attaches metadata to this signal’s watcher notifications.
Source§

fn debounce(self, duration: Duration) -> Debounce<Self, DefaultExecutor>
where Self::Output: Clone,

Creates a debounced version of this signal. Read more
Source§

fn throttle(self, duration: Duration) -> Throttle<Self, DefaultExecutor>
where Self::Output: Clone,

Creates a throttled version of this signal. Read more
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.
Source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,