Signal

Struct Signal 

Source
pub struct Signal<Args, R = (), C = DefaultCombiner, G = i32>
where Args: Clone + 'static, R: 'static, C: Combiner<R> + 'static, G: Ord + Send + Sync + 'static,
{ /* private fields */ }
Expand description

A handle to a signal with a slot function signature of Args -> R. C defines the combiner used to generate a return value when emit is envoked. G defines the ordering of groups of slots. Arguments given to the signal must implement Clone. If you need to emit a signal with an argument that doesn’t implement clone, that argument should be wrapped in an Arc<T> (as an example) to make it cloneable.

§Examples

use signals2::*;
 
let sig: Signal<()> = Signal::new();
sig.connect(|| println!("Hello, world!"));
sig.emit(); // prints "Hello, world!"

The only required template parameter for a Signal is the type of the parameters that the slot functions will accept, represented as a tuple. If we want our signal to have slot functions that accept two i32s as parameters, the template parameter will be (i32, i32). Slot functions may accept 0-12 parameters.

use signals2::*;

let sig: Signal<(i32, i32)> = Signal::new();
sig.connect(|x, y| println!("x + y = {}", x + y));
sig.emit(2, 3); // prints "x + y = 5"

Special care must be taken when creating Signals with slots that accept only one parameter. The single parameter type must still be represented as a tuple in the type signature of the Signal. The Rust compiler does not recognize (T) as a tuple-type of arity one, rather it recognizes it as simply the type T. A comma must be used to force the Rust compiler to recognize it as a tuple, e.x. (T,)

use signals2::*;

let sig: Signal<(i32,)> = Signal::new(); // Note that using Signal<(i32)> or Signal<i32> will not compile!
sig.connect(|x| println!("x = {}", x));
sig.emit(7); // prints "x = 7"

Slot functions can have return values, and the return value of the entire Signal is determined by the Combiner type. The default combiner simply returns an Option<R> with a value of Some(x) where x is the value returned by the last slot executed, or None in the case that no slots were executed.

use signals2::*;

let sig: Signal<(i32, i32), i32> = Signal::new();
assert_eq!(sig.emit(2, 3), None); // no slots have been added yet
sig.connect(|x, y| x + y);
assert_eq!(sig.emit(2, 3), Some(5));

Implementations§

Source§

impl<Args, R, C, G> Signal<Args, R, C, G>
where Args: Clone + 'static, R: 'static, C: Combiner<R> + 'static, G: Ord + Send + Sync + 'static,

Source

pub fn new_with_combiner(combiner: C) -> Self

Creates a new signal with a corresponding Combiner.

Source

pub fn weak(&self) -> WeakSignal<Args, R, C, G>

Creates a WeakSignal that holds a weak reference to its underling slots.

Source

pub fn get_connect_handle(&self) -> ConnectHandle<Args, R, C, G>

Creates a ConnectHandle that can be used to connect new slots to the signal.

Source

pub fn get_emit_handle(&self) -> EmitHandle<Args, R, C, G>

Creates an EmitHandle that can be used to emit the signal.

Source

pub fn set_combiner(&self, combiner: C)

Sets a new Combiner for the signal.

Source

pub fn clear(&self)

Disconnects all slots from the signal. Will cause any existing Connections to enter a “disconnected” state.

Source

pub fn count(&self) -> usize

Returns the number of connected slots for the signal.

Source§

impl<Args, R, C, G> Signal<Args, R, C, G>
where Args: Clone + 'static, R: 'static, C: Combiner<R> + Default + 'static, G: Ord + Send + Sync + 'static,

Source

pub fn new() -> Self

Equivalent to calling Signal::default().

Trait Implementations§

Source§

impl<Args, R, C, G> Clone for Signal<Args, R, C, G>
where Args: Clone + 'static, R: 'static, C: Combiner<R> + 'static, G: Ord + Send + Sync + 'static,

Source§

fn clone(&self) -> Self

Clones the corresponding signal. Note that a Signal is really just a handle to an underlying collection of slots. Cloning a signal will result in two handles that “point” to the same slots.

§Example
use signals2::*;

let sig1: Signal<()> = Signal::new();
let sig2 = sig1.clone();
sig1.connect(|| println!("Hello, world!")); // connect to the first signal
sig2.emit(); // prints "Hello, world!" because sig1 and sig2 share the same set of slots.
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<R, C, G> Connect0<R, C, G> for Signal<(), R, C, G>
where (): Clone + 'static, R: 'static, C: Combiner<R> + 'static, G: Ord + Send + Sync + 'static,

Source§

fn connect_group_position<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn() -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at the given Position
Source§

fn connect_group_position_extended<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(Connection) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at the given Position
Source§

fn connect_group<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn() -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position(f, group, Position::Back).
Source§

fn connect_position<F>(&self, f: F, pos: Position) -> Connection
where F: Fn() -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at the given position. Equivalent to calling connect_group_position(f, Group::Back, pos).
Source§

fn connect<F>(&self, f: F) -> Connection
where F: Fn() -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position(f, Group::Back, Position::Back).
Source§

fn connect_group_extended<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(Connection) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position_extended(f, group, Position::Back).
Source§

fn connect_position_extended<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(Connection) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at the given position. Equivalent to calling connect_group_position_extended(f, Group::Back, pos).
Source§

fn connect_extended<F>(&self, f: F) -> Connection
where F: Fn(Connection) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position_extended(f, Group::Back, Position::Back).
Source§

impl<R, C, G, T0> Connect1<R, C, G, T0> for Signal<(T0,), R, C, G>
where (T0,): Clone + 'static, R: 'static, C: Combiner<R> + 'static, G: Ord + Send + Sync + 'static,

Source§

fn connect_group_position<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(T0) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at the given Position
Source§

fn connect_group_position_extended<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(Connection, T0) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at the given Position
Source§

fn connect_group<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(T0) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position(f, group, Position::Back).
Source§

fn connect_position<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(T0) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at the given position. Equivalent to calling connect_group_position(f, Group::Back, pos).
Source§

fn connect<F>(&self, f: F) -> Connection
where F: Fn(T0) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position(f, Group::Back, Position::Back).
Source§

fn connect_group_extended<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(Connection, T0) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position_extended(f, group, Position::Back).
Source§

fn connect_position_extended<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(Connection, T0) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at the given position. Equivalent to calling connect_group_position_extended(f, Group::Back, pos).
Source§

fn connect_extended<F>(&self, f: F) -> Connection
where F: Fn(Connection, T0) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position_extended(f, Group::Back, Position::Back).
Source§

impl<R, C, G, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> Connect10<R, C, G, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> for Signal<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9), R, C, G>
where (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9): Clone + 'static, R: 'static, C: Combiner<R> + 'static, G: Ord + Send + Sync + 'static,

Source§

fn connect_group_position<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at the given Position
Source§

fn connect_group_position_extended<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at the given Position
Source§

fn connect_group<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position(f, group, Position::Back).
Source§

fn connect_position<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at the given position. Equivalent to calling connect_group_position(f, Group::Back, pos).
Source§

fn connect<F>(&self, f: F) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position(f, Group::Back, Position::Back).
Source§

fn connect_group_extended<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position_extended(f, group, Position::Back).
Source§

fn connect_position_extended<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at the given position. Equivalent to calling connect_group_position_extended(f, Group::Back, pos).
Source§

fn connect_extended<F>(&self, f: F) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position_extended(f, Group::Back, Position::Back).
Source§

impl<R, C, G, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Connect11<R, C, G, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> for Signal<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10), R, C, G>
where (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10): Clone + 'static, R: 'static, C: Combiner<R> + 'static, G: Ord + Send + Sync + 'static,

Source§

fn connect_group_position<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at the given Position
Source§

fn connect_group_position_extended<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at the given Position
Source§

fn connect_group<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position(f, group, Position::Back).
Source§

fn connect_position<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at the given position. Equivalent to calling connect_group_position(f, Group::Back, pos).
Source§

fn connect<F>(&self, f: F) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position(f, Group::Back, Position::Back).
Source§

fn connect_group_extended<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position_extended(f, group, Position::Back).
Source§

fn connect_position_extended<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at the given position. Equivalent to calling connect_group_position_extended(f, Group::Back, pos).
Source§

fn connect_extended<F>(&self, f: F) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position_extended(f, Group::Back, Position::Back).
Source§

impl<R, C, G, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Connect12<R, C, G, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> for Signal<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11), R, C, G>
where (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11): Clone + 'static, R: 'static, C: Combiner<R> + 'static, G: Ord + Send + Sync + 'static,

Source§

fn connect_group_position<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at the given Position
Source§

fn connect_group_position_extended<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at the given Position
Source§

fn connect_group<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position(f, group, Position::Back).
Source§

fn connect_position<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at the given position. Equivalent to calling connect_group_position(f, Group::Back, pos).
Source§

fn connect<F>(&self, f: F) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position(f, Group::Back, Position::Back).
Source§

fn connect_group_extended<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position_extended(f, group, Position::Back).
Source§

fn connect_position_extended<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at the given position. Equivalent to calling connect_group_position_extended(f, Group::Back, pos).
Source§

fn connect_extended<F>(&self, f: F) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position_extended(f, Group::Back, Position::Back).
Source§

impl<R, C, G, T0, T1> Connect2<R, C, G, T0, T1> for Signal<(T0, T1), R, C, G>
where (T0, T1): Clone + 'static, R: 'static, C: Combiner<R> + 'static, G: Ord + Send + Sync + 'static,

Source§

fn connect_group_position<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(T0, T1) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at the given Position
Source§

fn connect_group_position_extended<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(Connection, T0, T1) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at the given Position
Source§

fn connect_group<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(T0, T1) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position(f, group, Position::Back).
Source§

fn connect_position<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(T0, T1) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at the given position. Equivalent to calling connect_group_position(f, Group::Back, pos).
Source§

fn connect<F>(&self, f: F) -> Connection
where F: Fn(T0, T1) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position(f, Group::Back, Position::Back).
Source§

fn connect_group_extended<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(Connection, T0, T1) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position_extended(f, group, Position::Back).
Source§

fn connect_position_extended<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(Connection, T0, T1) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at the given position. Equivalent to calling connect_group_position_extended(f, Group::Back, pos).
Source§

fn connect_extended<F>(&self, f: F) -> Connection
where F: Fn(Connection, T0, T1) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position_extended(f, Group::Back, Position::Back).
Source§

impl<R, C, G, T0, T1, T2> Connect3<R, C, G, T0, T1, T2> for Signal<(T0, T1, T2), R, C, G>
where (T0, T1, T2): Clone + 'static, R: 'static, C: Combiner<R> + 'static, G: Ord + Send + Sync + 'static,

Source§

fn connect_group_position<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(T0, T1, T2) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at the given Position
Source§

fn connect_group_position_extended<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(Connection, T0, T1, T2) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at the given Position
Source§

fn connect_group<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(T0, T1, T2) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position(f, group, Position::Back).
Source§

fn connect_position<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(T0, T1, T2) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at the given position. Equivalent to calling connect_group_position(f, Group::Back, pos).
Source§

fn connect<F>(&self, f: F) -> Connection
where F: Fn(T0, T1, T2) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position(f, Group::Back, Position::Back).
Source§

fn connect_group_extended<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(Connection, T0, T1, T2) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position_extended(f, group, Position::Back).
Source§

fn connect_position_extended<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(Connection, T0, T1, T2) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at the given position. Equivalent to calling connect_group_position_extended(f, Group::Back, pos).
Source§

fn connect_extended<F>(&self, f: F) -> Connection
where F: Fn(Connection, T0, T1, T2) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position_extended(f, Group::Back, Position::Back).
Source§

impl<R, C, G, T0, T1, T2, T3> Connect4<R, C, G, T0, T1, T2, T3> for Signal<(T0, T1, T2, T3), R, C, G>
where (T0, T1, T2, T3): Clone + 'static, R: 'static, C: Combiner<R> + 'static, G: Ord + Send + Sync + 'static,

Source§

fn connect_group_position<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(T0, T1, T2, T3) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at the given Position
Source§

fn connect_group_position_extended<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(Connection, T0, T1, T2, T3) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at the given Position
Source§

fn connect_group<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(T0, T1, T2, T3) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position(f, group, Position::Back).
Source§

fn connect_position<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(T0, T1, T2, T3) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at the given position. Equivalent to calling connect_group_position(f, Group::Back, pos).
Source§

fn connect<F>(&self, f: F) -> Connection
where F: Fn(T0, T1, T2, T3) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position(f, Group::Back, Position::Back).
Source§

fn connect_group_extended<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(Connection, T0, T1, T2, T3) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position_extended(f, group, Position::Back).
Source§

fn connect_position_extended<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(Connection, T0, T1, T2, T3) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at the given position. Equivalent to calling connect_group_position_extended(f, Group::Back, pos).
Source§

fn connect_extended<F>(&self, f: F) -> Connection
where F: Fn(Connection, T0, T1, T2, T3) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position_extended(f, Group::Back, Position::Back).
Source§

impl<R, C, G, T0, T1, T2, T3, T4> Connect5<R, C, G, T0, T1, T2, T3, T4> for Signal<(T0, T1, T2, T3, T4), R, C, G>
where (T0, T1, T2, T3, T4): Clone + 'static, R: 'static, C: Combiner<R> + 'static, G: Ord + Send + Sync + 'static,

Source§

fn connect_group_position<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(T0, T1, T2, T3, T4) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at the given Position
Source§

fn connect_group_position_extended<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at the given Position
Source§

fn connect_group<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(T0, T1, T2, T3, T4) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position(f, group, Position::Back).
Source§

fn connect_position<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(T0, T1, T2, T3, T4) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at the given position. Equivalent to calling connect_group_position(f, Group::Back, pos).
Source§

fn connect<F>(&self, f: F) -> Connection
where F: Fn(T0, T1, T2, T3, T4) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position(f, Group::Back, Position::Back).
Source§

fn connect_group_extended<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position_extended(f, group, Position::Back).
Source§

fn connect_position_extended<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at the given position. Equivalent to calling connect_group_position_extended(f, Group::Back, pos).
Source§

fn connect_extended<F>(&self, f: F) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position_extended(f, Group::Back, Position::Back).
Source§

impl<R, C, G, T0, T1, T2, T3, T4, T5> Connect6<R, C, G, T0, T1, T2, T3, T4, T5> for Signal<(T0, T1, T2, T3, T4, T5), R, C, G>
where (T0, T1, T2, T3, T4, T5): Clone + 'static, R: 'static, C: Combiner<R> + 'static, G: Ord + Send + Sync + 'static,

Source§

fn connect_group_position<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at the given Position
Source§

fn connect_group_position_extended<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at the given Position
Source§

fn connect_group<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position(f, group, Position::Back).
Source§

fn connect_position<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at the given position. Equivalent to calling connect_group_position(f, Group::Back, pos).
Source§

fn connect<F>(&self, f: F) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position(f, Group::Back, Position::Back).
Source§

fn connect_group_extended<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position_extended(f, group, Position::Back).
Source§

fn connect_position_extended<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at the given position. Equivalent to calling connect_group_position_extended(f, Group::Back, pos).
Source§

fn connect_extended<F>(&self, f: F) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position_extended(f, Group::Back, Position::Back).
Source§

impl<R, C, G, T0, T1, T2, T3, T4, T5, T6> Connect7<R, C, G, T0, T1, T2, T3, T4, T5, T6> for Signal<(T0, T1, T2, T3, T4, T5, T6), R, C, G>
where (T0, T1, T2, T3, T4, T5, T6): Clone + 'static, R: 'static, C: Combiner<R> + 'static, G: Ord + Send + Sync + 'static,

Source§

fn connect_group_position<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at the given Position
Source§

fn connect_group_position_extended<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at the given Position
Source§

fn connect_group<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position(f, group, Position::Back).
Source§

fn connect_position<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at the given position. Equivalent to calling connect_group_position(f, Group::Back, pos).
Source§

fn connect<F>(&self, f: F) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position(f, Group::Back, Position::Back).
Source§

fn connect_group_extended<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position_extended(f, group, Position::Back).
Source§

fn connect_position_extended<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at the given position. Equivalent to calling connect_group_position_extended(f, Group::Back, pos).
Source§

fn connect_extended<F>(&self, f: F) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position_extended(f, Group::Back, Position::Back).
Source§

impl<R, C, G, T0, T1, T2, T3, T4, T5, T6, T7> Connect8<R, C, G, T0, T1, T2, T3, T4, T5, T6, T7> for Signal<(T0, T1, T2, T3, T4, T5, T6, T7), R, C, G>
where (T0, T1, T2, T3, T4, T5, T6, T7): Clone + 'static, R: 'static, C: Combiner<R> + 'static, G: Ord + Send + Sync + 'static,

Source§

fn connect_group_position<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6, T7) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at the given Position
Source§

fn connect_group_position_extended<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6, T7) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at the given Position
Source§

fn connect_group<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6, T7) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position(f, group, Position::Back).
Source§

fn connect_position<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6, T7) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at the given position. Equivalent to calling connect_group_position(f, Group::Back, pos).
Source§

fn connect<F>(&self, f: F) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6, T7) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position(f, Group::Back, Position::Back).
Source§

fn connect_group_extended<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6, T7) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position_extended(f, group, Position::Back).
Source§

fn connect_position_extended<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6, T7) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at the given position. Equivalent to calling connect_group_position_extended(f, Group::Back, pos).
Source§

fn connect_extended<F>(&self, f: F) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6, T7) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position_extended(f, Group::Back, Position::Back).
Source§

impl<R, C, G, T0, T1, T2, T3, T4, T5, T6, T7, T8> Connect9<R, C, G, T0, T1, T2, T3, T4, T5, T6, T7, T8> for Signal<(T0, T1, T2, T3, T4, T5, T6, T7, T8), R, C, G>
where (T0, T1, T2, T3, T4, T5, T6, T7, T8): Clone + 'static, R: 'static, C: Combiner<R> + 'static, G: Ord + Send + Sync + 'static,

Source§

fn connect_group_position<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at the given Position
Source§

fn connect_group_position_extended<F>( &self, f: F, group: Group<G>, pos: Position, ) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6, T7, T8) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at the given Position
Source§

fn connect_group<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8) -> R + Send + Sync + 'static,

Connects the slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position(f, group, Position::Back).
Source§

fn connect_position<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at the given position. Equivalent to calling connect_group_position(f, Group::Back, pos).
Source§

fn connect<F>(&self, f: F) -> Connection
where F: Fn(T0, T1, T2, T3, T4, T5, T6, T7, T8) -> R + Send + Sync + 'static,

Connects the slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position(f, Group::Back, Position::Back).
Source§

fn connect_group_extended<F>(&self, f: F, group: Group<G>) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6, T7, T8) -> R + Send + Sync + 'static,

Connects the extended slot function f to the given Group at Position::Back. Equivalent to calling connect_group_position_extended(f, group, Position::Back).
Source§

fn connect_position_extended<F>(&self, f: F, pos: Position) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6, T7, T8) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at the given position. Equivalent to calling connect_group_position_extended(f, Group::Back, pos).
Source§

fn connect_extended<F>(&self, f: F) -> Connection
where F: Fn(Connection, T0, T1, T2, T3, T4, T5, T6, T7, T8) -> R + Send + Sync + 'static,

Connects the extended slot function f to Group::Back at Position::Back. Equivalent to calling connect_group_position_extended(f, Group::Back, Position::Back).
Source§

impl<Args, R, C, G> Default for Signal<Args, R, C, G>
where Args: Clone + 'static, R: 'static, C: Combiner<R> + Default + 'static, G: Ord + Send + Sync + 'static,

Source§

fn default() -> Self

Creates a default signal with a Combiner created by calling C::default().

Source§

impl<R, C, G> Emit0<R, C> for Signal<(), R, C, G>
where (): Clone, C: Combiner<R> + 'static, G: Ord + Send + Sync,

Source§

type Output = <C as Combiner<R>>::Output

The return value of emit will be C::Output for Signals and Option<C::Output> for EmitHandles
Source§

fn emit(&self) -> C::Output

Executes the signal’s underlying slots, passing clones of the given arguments to the slot functions.
Source§

impl<R, C, G, T0> Emit1<R, C, T0> for Signal<(T0,), R, C, G>
where (T0,): Clone, C: Combiner<R> + 'static, G: Ord + Send + Sync,

Source§

type Output = <C as Combiner<R>>::Output

The return value of emit will be C::Output for Signals and Option<C::Output> for EmitHandles
Source§

fn emit(&self, a: T0) -> C::Output

Executes the signal’s underlying slots, passing clones of the given arguments to the slot functions.
Source§

impl<R, C, G, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> Emit10<R, C, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> for Signal<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9), R, C, G>

Source§

type Output = <C as Combiner<R>>::Output

The return value of emit will be C::Output for Signals and Option<C::Output> for EmitHandles
Source§

fn emit( &self, a: T0, b: T1, c: T2, d: T3, e: T4, f: T5, g: T6, h: T7, i: T8, j: T9, ) -> C::Output

Executes the signal’s underlying slots, passing clones of the given arguments to the slot functions.
Source§

impl<R, C, G, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Emit11<R, C, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> for Signal<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10), R, C, G>

Source§

type Output = <C as Combiner<R>>::Output

The return value of emit will be C::Output for Signals and Option<C::Output> for EmitHandles
Source§

fn emit( &self, a: T0, b: T1, c: T2, d: T3, e: T4, f: T5, g: T6, h: T7, i: T8, j: T9, k: T10, ) -> C::Output

Executes the signal’s underlying slots, passing clones of the given arguments to the slot functions.
Source§

impl<R, C, G, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Emit12<R, C, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> for Signal<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11), R, C, G>

Source§

type Output = <C as Combiner<R>>::Output

The return value of emit will be C::Output for Signals and Option<C::Output> for EmitHandles
Source§

fn emit( &self, a: T0, b: T1, c: T2, d: T3, e: T4, f: T5, g: T6, h: T7, i: T8, j: T9, k: T10, l: T11, ) -> C::Output

Executes the signal’s underlying slots, passing clones of the given arguments to the slot functions.
Source§

impl<R, C, G, T0, T1> Emit2<R, C, T0, T1> for Signal<(T0, T1), R, C, G>
where (T0, T1): Clone, C: Combiner<R> + 'static, G: Ord + Send + Sync,

Source§

type Output = <C as Combiner<R>>::Output

The return value of emit will be C::Output for Signals and Option<C::Output> for EmitHandles
Source§

fn emit(&self, a: T0, b: T1) -> C::Output

Executes the signal’s underlying slots, passing clones of the given arguments to the slot functions.
Source§

impl<R, C, G, T0, T1, T2> Emit3<R, C, T0, T1, T2> for Signal<(T0, T1, T2), R, C, G>
where (T0, T1, T2): Clone, C: Combiner<R> + 'static, G: Ord + Send + Sync,

Source§

type Output = <C as Combiner<R>>::Output

The return value of emit will be C::Output for Signals and Option<C::Output> for EmitHandles
Source§

fn emit(&self, a: T0, b: T1, c: T2) -> C::Output

Executes the signal’s underlying slots, passing clones of the given arguments to the slot functions.
Source§

impl<R, C, G, T0, T1, T2, T3> Emit4<R, C, T0, T1, T2, T3> for Signal<(T0, T1, T2, T3), R, C, G>
where (T0, T1, T2, T3): Clone, C: Combiner<R> + 'static, G: Ord + Send + Sync,

Source§

type Output = <C as Combiner<R>>::Output

The return value of emit will be C::Output for Signals and Option<C::Output> for EmitHandles
Source§

fn emit(&self, a: T0, b: T1, c: T2, d: T3) -> C::Output

Executes the signal’s underlying slots, passing clones of the given arguments to the slot functions.
Source§

impl<R, C, G, T0, T1, T2, T3, T4> Emit5<R, C, T0, T1, T2, T3, T4> for Signal<(T0, T1, T2, T3, T4), R, C, G>
where (T0, T1, T2, T3, T4): Clone, C: Combiner<R> + 'static, G: Ord + Send + Sync,

Source§

type Output = <C as Combiner<R>>::Output

The return value of emit will be C::Output for Signals and Option<C::Output> for EmitHandles
Source§

fn emit(&self, a: T0, b: T1, c: T2, d: T3, e: T4) -> C::Output

Executes the signal’s underlying slots, passing clones of the given arguments to the slot functions.
Source§

impl<R, C, G, T0, T1, T2, T3, T4, T5> Emit6<R, C, T0, T1, T2, T3, T4, T5> for Signal<(T0, T1, T2, T3, T4, T5), R, C, G>
where (T0, T1, T2, T3, T4, T5): Clone, C: Combiner<R> + 'static, G: Ord + Send + Sync,

Source§

type Output = <C as Combiner<R>>::Output

The return value of emit will be C::Output for Signals and Option<C::Output> for EmitHandles
Source§

fn emit(&self, a: T0, b: T1, c: T2, d: T3, e: T4, f: T5) -> C::Output

Executes the signal’s underlying slots, passing clones of the given arguments to the slot functions.
Source§

impl<R, C, G, T0, T1, T2, T3, T4, T5, T6> Emit7<R, C, T0, T1, T2, T3, T4, T5, T6> for Signal<(T0, T1, T2, T3, T4, T5, T6), R, C, G>
where (T0, T1, T2, T3, T4, T5, T6): Clone, C: Combiner<R> + 'static, G: Ord + Send + Sync,

Source§

type Output = <C as Combiner<R>>::Output

The return value of emit will be C::Output for Signals and Option<C::Output> for EmitHandles
Source§

fn emit(&self, a: T0, b: T1, c: T2, d: T3, e: T4, f: T5, g: T6) -> C::Output

Executes the signal’s underlying slots, passing clones of the given arguments to the slot functions.
Source§

impl<R, C, G, T0, T1, T2, T3, T4, T5, T6, T7> Emit8<R, C, T0, T1, T2, T3, T4, T5, T6, T7> for Signal<(T0, T1, T2, T3, T4, T5, T6, T7), R, C, G>
where (T0, T1, T2, T3, T4, T5, T6, T7): Clone, C: Combiner<R> + 'static, G: Ord + Send + Sync,

Source§

type Output = <C as Combiner<R>>::Output

The return value of emit will be C::Output for Signals and Option<C::Output> for EmitHandles
Source§

fn emit( &self, a: T0, b: T1, c: T2, d: T3, e: T4, f: T5, g: T6, h: T7, ) -> C::Output

Executes the signal’s underlying slots, passing clones of the given arguments to the slot functions.
Source§

impl<R, C, G, T0, T1, T2, T3, T4, T5, T6, T7, T8> Emit9<R, C, T0, T1, T2, T3, T4, T5, T6, T7, T8> for Signal<(T0, T1, T2, T3, T4, T5, T6, T7, T8), R, C, G>

Source§

type Output = <C as Combiner<R>>::Output

The return value of emit will be C::Output for Signals and Option<C::Output> for EmitHandles
Source§

fn emit( &self, a: T0, b: T1, c: T2, d: T3, e: T4, f: T5, g: T6, h: T7, i: T8, ) -> C::Output

Executes the signal’s underlying slots, passing clones of the given arguments to the slot functions.

Auto Trait Implementations§

§

impl<Args, R, C, G> Freeze for Signal<Args, R, C, G>

§

impl<Args, R, C, G> RefUnwindSafe for Signal<Args, R, C, G>

§

impl<Args, R, C, G> Send for Signal<Args, R, C, G>

§

impl<Args, R, C, G> Sync for Signal<Args, R, C, G>

§

impl<Args, R, C, G> Unpin for Signal<Args, R, C, G>

§

impl<Args, R, C, G> UnwindSafe for Signal<Args, R, C, G>

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.