Struct SystemOperation

Source
pub struct SystemOperation(/* private fields */);
Expand description

A built-in operation like MPI_SUM

§Examples

See examples/reduce.rs

§Standard section(s)

5.9.2

Implementations§

Source§

impl SystemOperation

Source

pub fn max() -> SystemOperation

A built-in operation

Examples found in repository?
examples/immediate_reduce.rs (line 97)
68fn main() {
69    let universe = mpi::initialize().unwrap();
70    let world = universe.world();
71    let rank = world.rank();
72    let size = world.size();
73    let root_rank = 0;
74
75    if rank == root_rank {
76        let mut sum: Rank = 0;
77        mpi::request::scope(|scope| {
78            world
79                .process_at_rank(root_rank)
80                .immediate_reduce_into_root(scope, &rank, &mut sum, SystemOperation::sum())
81                .wait();
82        });
83        assert_eq!(sum, size * (size - 1) / 2);
84    } else {
85        mpi::request::scope(|scope| {
86            world
87                .process_at_rank(root_rank)
88                .immediate_reduce_into(scope, &rank, SystemOperation::sum())
89                .wait();
90        });
91    }
92
93    let mut max: Rank = -1;
94
95    mpi::request::scope(|scope| {
96        world
97            .immediate_all_reduce_into(scope, &rank, &mut max, SystemOperation::max())
98            .wait();
99    });
100    assert_eq!(max, size - 1);
101
102    let a = (0..size).collect::<Vec<_>>();
103    let mut b: Rank = 0;
104
105    mpi::request::scope(|scope| {
106        world
107            .immediate_reduce_scatter_block_into(scope, &a[..], &mut b, SystemOperation::product())
108            .wait();
109    });
110    assert_eq!(b, rank.wrapping_pow(size as u32));
111
112    test_user_operations(universe.world());
113
114    let mut d = 0;
115    let op = unsafe { UnsafeUserOperation::commutative(unsafe_add) };
116    mpi::request::scope(|scope| {
117        world
118            .immediate_all_reduce_into(scope, &rank, &mut d, &op)
119            .wait();
120    });
121    assert_eq!(d, size * (size - 1) / 2);
122}
More examples
Hide additional examples
examples/reduce.rs (line 90)
69fn main() {
70    let universe = mpi::initialize().unwrap();
71    let world = universe.world();
72    let rank = world.rank();
73    let size = world.size();
74    let root_rank = 0;
75
76    if rank == root_rank {
77        let mut sum: Rank = 0;
78        world
79            .process_at_rank(root_rank)
80            .reduce_into_root(&rank, &mut sum, SystemOperation::sum());
81        assert_eq!(sum, size * (size - 1) / 2);
82    } else {
83        world
84            .process_at_rank(root_rank)
85            .reduce_into(&rank, SystemOperation::sum());
86    }
87
88    let mut max: Rank = -1;
89
90    world.all_reduce_into(&rank, &mut max, SystemOperation::max());
91    assert_eq!(max, size - 1);
92
93    let a: u16 = 0b0000_1111_1111_0000;
94    let b: u16 = 0b0011_1100_0011_1100;
95
96    let mut c = b;
97    collective::reduce_local_into(&a, &mut c, SystemOperation::bitwise_and());
98    assert_eq!(c, 0b0000_1100_0011_0000);
99
100    let mut d = b;
101    collective::reduce_local_into(&a, &mut d, SystemOperation::bitwise_or());
102    assert_eq!(d, 0b0011_1111_1111_1100);
103
104    let mut e = b;
105    collective::reduce_local_into(&a, &mut e, SystemOperation::bitwise_xor());
106    assert_eq!(e, 0b0011_0011_1100_1100);
107
108    let f = (0..size).collect::<Vec<_>>();
109    let mut g: Rank = 0;
110
111    world.reduce_scatter_block_into(&f[..], &mut g, SystemOperation::product());
112    assert_eq!(g, rank.wrapping_pow(size as u32));
113
114    test_user_operations(universe.world());
115
116    let mut i = 0;
117    let op = unsafe { UnsafeUserOperation::commutative(unsafe_add) };
118    world.all_reduce_into(&(rank + 1), &mut i, &op);
119    assert_eq!(i, size * (size + 1) / 2);
120}
Source

pub fn min() -> SystemOperation

A built-in operation

Source

pub fn sum() -> SystemOperation

A built-in operation

Examples found in repository?
examples/scan.rs (line 18)
12fn main() {
13    let universe = mpi::initialize().unwrap();
14    let world = universe.world();
15    let rank = world.rank();
16
17    let mut x = 0;
18    world.scan_into(&rank, &mut x, &SystemOperation::sum());
19    assert_eq!(x, (rank * (rank + 1)) / 2);
20
21    let y = rank + 1;
22    let mut z = 0;
23    world.exclusive_scan_into(&y, &mut z, &SystemOperation::product());
24    if rank > 0 {
25        assert_eq!(z, fac(y - 1));
26    }
27}
More examples
Hide additional examples
examples/immediate_scan.rs (line 20)
12fn main() {
13    let universe = mpi::initialize().unwrap();
14    let world = universe.world();
15    let rank = world.rank();
16
17    let mut x = 0;
18    mpi::request::scope(|scope| {
19        world
20            .immediate_scan_into(scope, &rank, &mut x, SystemOperation::sum())
21            .wait();
22    });
23    assert_eq!(x, (rank * (rank + 1)) / 2);
24
25    let y = rank + 1;
26    let mut z = 0;
27    mpi::request::scope(|scope| {
28        world
29            .immediate_exclusive_scan_into(scope, &y, &mut z, SystemOperation::product())
30            .wait();
31    });
32    if rank > 0 {
33        assert_eq!(z, fac(y - 1));
34    }
35}
examples/immediate_reduce.rs (line 80)
68fn main() {
69    let universe = mpi::initialize().unwrap();
70    let world = universe.world();
71    let rank = world.rank();
72    let size = world.size();
73    let root_rank = 0;
74
75    if rank == root_rank {
76        let mut sum: Rank = 0;
77        mpi::request::scope(|scope| {
78            world
79                .process_at_rank(root_rank)
80                .immediate_reduce_into_root(scope, &rank, &mut sum, SystemOperation::sum())
81                .wait();
82        });
83        assert_eq!(sum, size * (size - 1) / 2);
84    } else {
85        mpi::request::scope(|scope| {
86            world
87                .process_at_rank(root_rank)
88                .immediate_reduce_into(scope, &rank, SystemOperation::sum())
89                .wait();
90        });
91    }
92
93    let mut max: Rank = -1;
94
95    mpi::request::scope(|scope| {
96        world
97            .immediate_all_reduce_into(scope, &rank, &mut max, SystemOperation::max())
98            .wait();
99    });
100    assert_eq!(max, size - 1);
101
102    let a = (0..size).collect::<Vec<_>>();
103    let mut b: Rank = 0;
104
105    mpi::request::scope(|scope| {
106        world
107            .immediate_reduce_scatter_block_into(scope, &a[..], &mut b, SystemOperation::product())
108            .wait();
109    });
110    assert_eq!(b, rank.wrapping_pow(size as u32));
111
112    test_user_operations(universe.world());
113
114    let mut d = 0;
115    let op = unsafe { UnsafeUserOperation::commutative(unsafe_add) };
116    mpi::request::scope(|scope| {
117        world
118            .immediate_all_reduce_into(scope, &rank, &mut d, &op)
119            .wait();
120    });
121    assert_eq!(d, size * (size - 1) / 2);
122}
examples/reduce.rs (line 80)
69fn main() {
70    let universe = mpi::initialize().unwrap();
71    let world = universe.world();
72    let rank = world.rank();
73    let size = world.size();
74    let root_rank = 0;
75
76    if rank == root_rank {
77        let mut sum: Rank = 0;
78        world
79            .process_at_rank(root_rank)
80            .reduce_into_root(&rank, &mut sum, SystemOperation::sum());
81        assert_eq!(sum, size * (size - 1) / 2);
82    } else {
83        world
84            .process_at_rank(root_rank)
85            .reduce_into(&rank, SystemOperation::sum());
86    }
87
88    let mut max: Rank = -1;
89
90    world.all_reduce_into(&rank, &mut max, SystemOperation::max());
91    assert_eq!(max, size - 1);
92
93    let a: u16 = 0b0000_1111_1111_0000;
94    let b: u16 = 0b0011_1100_0011_1100;
95
96    let mut c = b;
97    collective::reduce_local_into(&a, &mut c, SystemOperation::bitwise_and());
98    assert_eq!(c, 0b0000_1100_0011_0000);
99
100    let mut d = b;
101    collective::reduce_local_into(&a, &mut d, SystemOperation::bitwise_or());
102    assert_eq!(d, 0b0011_1111_1111_1100);
103
104    let mut e = b;
105    collective::reduce_local_into(&a, &mut e, SystemOperation::bitwise_xor());
106    assert_eq!(e, 0b0011_0011_1100_1100);
107
108    let f = (0..size).collect::<Vec<_>>();
109    let mut g: Rank = 0;
110
111    world.reduce_scatter_block_into(&f[..], &mut g, SystemOperation::product());
112    assert_eq!(g, rank.wrapping_pow(size as u32));
113
114    test_user_operations(universe.world());
115
116    let mut i = 0;
117    let op = unsafe { UnsafeUserOperation::commutative(unsafe_add) };
118    world.all_reduce_into(&(rank + 1), &mut i, &op);
119    assert_eq!(i, size * (size + 1) / 2);
120}
Source

pub fn product() -> SystemOperation

A built-in operation

Examples found in repository?
examples/scan.rs (line 23)
12fn main() {
13    let universe = mpi::initialize().unwrap();
14    let world = universe.world();
15    let rank = world.rank();
16
17    let mut x = 0;
18    world.scan_into(&rank, &mut x, &SystemOperation::sum());
19    assert_eq!(x, (rank * (rank + 1)) / 2);
20
21    let y = rank + 1;
22    let mut z = 0;
23    world.exclusive_scan_into(&y, &mut z, &SystemOperation::product());
24    if rank > 0 {
25        assert_eq!(z, fac(y - 1));
26    }
27}
More examples
Hide additional examples
examples/immediate_scan.rs (line 29)
12fn main() {
13    let universe = mpi::initialize().unwrap();
14    let world = universe.world();
15    let rank = world.rank();
16
17    let mut x = 0;
18    mpi::request::scope(|scope| {
19        world
20            .immediate_scan_into(scope, &rank, &mut x, SystemOperation::sum())
21            .wait();
22    });
23    assert_eq!(x, (rank * (rank + 1)) / 2);
24
25    let y = rank + 1;
26    let mut z = 0;
27    mpi::request::scope(|scope| {
28        world
29            .immediate_exclusive_scan_into(scope, &y, &mut z, SystemOperation::product())
30            .wait();
31    });
32    if rank > 0 {
33        assert_eq!(z, fac(y - 1));
34    }
35}
examples/immediate_reduce.rs (line 107)
68fn main() {
69    let universe = mpi::initialize().unwrap();
70    let world = universe.world();
71    let rank = world.rank();
72    let size = world.size();
73    let root_rank = 0;
74
75    if rank == root_rank {
76        let mut sum: Rank = 0;
77        mpi::request::scope(|scope| {
78            world
79                .process_at_rank(root_rank)
80                .immediate_reduce_into_root(scope, &rank, &mut sum, SystemOperation::sum())
81                .wait();
82        });
83        assert_eq!(sum, size * (size - 1) / 2);
84    } else {
85        mpi::request::scope(|scope| {
86            world
87                .process_at_rank(root_rank)
88                .immediate_reduce_into(scope, &rank, SystemOperation::sum())
89                .wait();
90        });
91    }
92
93    let mut max: Rank = -1;
94
95    mpi::request::scope(|scope| {
96        world
97            .immediate_all_reduce_into(scope, &rank, &mut max, SystemOperation::max())
98            .wait();
99    });
100    assert_eq!(max, size - 1);
101
102    let a = (0..size).collect::<Vec<_>>();
103    let mut b: Rank = 0;
104
105    mpi::request::scope(|scope| {
106        world
107            .immediate_reduce_scatter_block_into(scope, &a[..], &mut b, SystemOperation::product())
108            .wait();
109    });
110    assert_eq!(b, rank.wrapping_pow(size as u32));
111
112    test_user_operations(universe.world());
113
114    let mut d = 0;
115    let op = unsafe { UnsafeUserOperation::commutative(unsafe_add) };
116    mpi::request::scope(|scope| {
117        world
118            .immediate_all_reduce_into(scope, &rank, &mut d, &op)
119            .wait();
120    });
121    assert_eq!(d, size * (size - 1) / 2);
122}
examples/reduce.rs (line 111)
69fn main() {
70    let universe = mpi::initialize().unwrap();
71    let world = universe.world();
72    let rank = world.rank();
73    let size = world.size();
74    let root_rank = 0;
75
76    if rank == root_rank {
77        let mut sum: Rank = 0;
78        world
79            .process_at_rank(root_rank)
80            .reduce_into_root(&rank, &mut sum, SystemOperation::sum());
81        assert_eq!(sum, size * (size - 1) / 2);
82    } else {
83        world
84            .process_at_rank(root_rank)
85            .reduce_into(&rank, SystemOperation::sum());
86    }
87
88    let mut max: Rank = -1;
89
90    world.all_reduce_into(&rank, &mut max, SystemOperation::max());
91    assert_eq!(max, size - 1);
92
93    let a: u16 = 0b0000_1111_1111_0000;
94    let b: u16 = 0b0011_1100_0011_1100;
95
96    let mut c = b;
97    collective::reduce_local_into(&a, &mut c, SystemOperation::bitwise_and());
98    assert_eq!(c, 0b0000_1100_0011_0000);
99
100    let mut d = b;
101    collective::reduce_local_into(&a, &mut d, SystemOperation::bitwise_or());
102    assert_eq!(d, 0b0011_1111_1111_1100);
103
104    let mut e = b;
105    collective::reduce_local_into(&a, &mut e, SystemOperation::bitwise_xor());
106    assert_eq!(e, 0b0011_0011_1100_1100);
107
108    let f = (0..size).collect::<Vec<_>>();
109    let mut g: Rank = 0;
110
111    world.reduce_scatter_block_into(&f[..], &mut g, SystemOperation::product());
112    assert_eq!(g, rank.wrapping_pow(size as u32));
113
114    test_user_operations(universe.world());
115
116    let mut i = 0;
117    let op = unsafe { UnsafeUserOperation::commutative(unsafe_add) };
118    world.all_reduce_into(&(rank + 1), &mut i, &op);
119    assert_eq!(i, size * (size + 1) / 2);
120}
Source

pub fn logical_and() -> SystemOperation

A built-in operation

Source

pub fn bitwise_and() -> SystemOperation

A built-in operation

Examples found in repository?
examples/reduce.rs (line 97)
69fn main() {
70    let universe = mpi::initialize().unwrap();
71    let world = universe.world();
72    let rank = world.rank();
73    let size = world.size();
74    let root_rank = 0;
75
76    if rank == root_rank {
77        let mut sum: Rank = 0;
78        world
79            .process_at_rank(root_rank)
80            .reduce_into_root(&rank, &mut sum, SystemOperation::sum());
81        assert_eq!(sum, size * (size - 1) / 2);
82    } else {
83        world
84            .process_at_rank(root_rank)
85            .reduce_into(&rank, SystemOperation::sum());
86    }
87
88    let mut max: Rank = -1;
89
90    world.all_reduce_into(&rank, &mut max, SystemOperation::max());
91    assert_eq!(max, size - 1);
92
93    let a: u16 = 0b0000_1111_1111_0000;
94    let b: u16 = 0b0011_1100_0011_1100;
95
96    let mut c = b;
97    collective::reduce_local_into(&a, &mut c, SystemOperation::bitwise_and());
98    assert_eq!(c, 0b0000_1100_0011_0000);
99
100    let mut d = b;
101    collective::reduce_local_into(&a, &mut d, SystemOperation::bitwise_or());
102    assert_eq!(d, 0b0011_1111_1111_1100);
103
104    let mut e = b;
105    collective::reduce_local_into(&a, &mut e, SystemOperation::bitwise_xor());
106    assert_eq!(e, 0b0011_0011_1100_1100);
107
108    let f = (0..size).collect::<Vec<_>>();
109    let mut g: Rank = 0;
110
111    world.reduce_scatter_block_into(&f[..], &mut g, SystemOperation::product());
112    assert_eq!(g, rank.wrapping_pow(size as u32));
113
114    test_user_operations(universe.world());
115
116    let mut i = 0;
117    let op = unsafe { UnsafeUserOperation::commutative(unsafe_add) };
118    world.all_reduce_into(&(rank + 1), &mut i, &op);
119    assert_eq!(i, size * (size + 1) / 2);
120}
Source

pub fn logical_or() -> SystemOperation

A built-in operation

Source

pub fn bitwise_or() -> SystemOperation

A built-in operation

Examples found in repository?
examples/reduce.rs (line 101)
69fn main() {
70    let universe = mpi::initialize().unwrap();
71    let world = universe.world();
72    let rank = world.rank();
73    let size = world.size();
74    let root_rank = 0;
75
76    if rank == root_rank {
77        let mut sum: Rank = 0;
78        world
79            .process_at_rank(root_rank)
80            .reduce_into_root(&rank, &mut sum, SystemOperation::sum());
81        assert_eq!(sum, size * (size - 1) / 2);
82    } else {
83        world
84            .process_at_rank(root_rank)
85            .reduce_into(&rank, SystemOperation::sum());
86    }
87
88    let mut max: Rank = -1;
89
90    world.all_reduce_into(&rank, &mut max, SystemOperation::max());
91    assert_eq!(max, size - 1);
92
93    let a: u16 = 0b0000_1111_1111_0000;
94    let b: u16 = 0b0011_1100_0011_1100;
95
96    let mut c = b;
97    collective::reduce_local_into(&a, &mut c, SystemOperation::bitwise_and());
98    assert_eq!(c, 0b0000_1100_0011_0000);
99
100    let mut d = b;
101    collective::reduce_local_into(&a, &mut d, SystemOperation::bitwise_or());
102    assert_eq!(d, 0b0011_1111_1111_1100);
103
104    let mut e = b;
105    collective::reduce_local_into(&a, &mut e, SystemOperation::bitwise_xor());
106    assert_eq!(e, 0b0011_0011_1100_1100);
107
108    let f = (0..size).collect::<Vec<_>>();
109    let mut g: Rank = 0;
110
111    world.reduce_scatter_block_into(&f[..], &mut g, SystemOperation::product());
112    assert_eq!(g, rank.wrapping_pow(size as u32));
113
114    test_user_operations(universe.world());
115
116    let mut i = 0;
117    let op = unsafe { UnsafeUserOperation::commutative(unsafe_add) };
118    world.all_reduce_into(&(rank + 1), &mut i, &op);
119    assert_eq!(i, size * (size + 1) / 2);
120}
Source

pub fn logical_xor() -> SystemOperation

A built-in operation

Source

pub fn bitwise_xor() -> SystemOperation

A built-in operation

Examples found in repository?
examples/reduce.rs (line 105)
69fn main() {
70    let universe = mpi::initialize().unwrap();
71    let world = universe.world();
72    let rank = world.rank();
73    let size = world.size();
74    let root_rank = 0;
75
76    if rank == root_rank {
77        let mut sum: Rank = 0;
78        world
79            .process_at_rank(root_rank)
80            .reduce_into_root(&rank, &mut sum, SystemOperation::sum());
81        assert_eq!(sum, size * (size - 1) / 2);
82    } else {
83        world
84            .process_at_rank(root_rank)
85            .reduce_into(&rank, SystemOperation::sum());
86    }
87
88    let mut max: Rank = -1;
89
90    world.all_reduce_into(&rank, &mut max, SystemOperation::max());
91    assert_eq!(max, size - 1);
92
93    let a: u16 = 0b0000_1111_1111_0000;
94    let b: u16 = 0b0011_1100_0011_1100;
95
96    let mut c = b;
97    collective::reduce_local_into(&a, &mut c, SystemOperation::bitwise_and());
98    assert_eq!(c, 0b0000_1100_0011_0000);
99
100    let mut d = b;
101    collective::reduce_local_into(&a, &mut d, SystemOperation::bitwise_or());
102    assert_eq!(d, 0b0011_1111_1111_1100);
103
104    let mut e = b;
105    collective::reduce_local_into(&a, &mut e, SystemOperation::bitwise_xor());
106    assert_eq!(e, 0b0011_0011_1100_1100);
107
108    let f = (0..size).collect::<Vec<_>>();
109    let mut g: Rank = 0;
110
111    world.reduce_scatter_block_into(&f[..], &mut g, SystemOperation::product());
112    assert_eq!(g, rank.wrapping_pow(size as u32));
113
114    test_user_operations(universe.world());
115
116    let mut i = 0;
117    let op = unsafe { UnsafeUserOperation::commutative(unsafe_add) };
118    world.all_reduce_into(&(rank + 1), &mut i, &op);
119    assert_eq!(i, size * (size + 1) / 2);
120}

Trait Implementations§

Source§

impl AsRaw for SystemOperation

Source§

type Raw = *mut ompi_op_t

The raw MPI C API type
Source§

fn as_raw(&self) -> Self::Raw

The raw value
Source§

impl Clone for SystemOperation

Source§

fn clone(&self) -> SystemOperation

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

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

Performs copy-assignment from source. Read more
Source§

impl Operation for SystemOperation

Source§

fn is_commutative(&self) -> bool

Returns whether the operation is commutative. Read more
Source§

impl Copy for SystemOperation

Auto Trait Implementations§

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<Src, Scheme> ApproxFrom<Src, Scheme> for Src
where Scheme: ApproxScheme,

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>

Convert the given value into an approximately equivalent representation.
Source§

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src
where Dst: ApproxFrom<Src, Scheme>, Scheme: ApproxScheme,

Source§

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.
Source§

fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>

Convert the subject into an approximately equivalent representation.
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, dst: *mut u8)

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

impl<T, Dst> ConvAsUtil<Dst> for T

Source§

fn approx(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject with the default scheme.
Source§

fn approx_by<Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject with a specific scheme.
Source§

impl<T> ConvUtil for T

Source§

fn approx_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject to a given type with the default scheme.
Source§

fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject to a given type with a specific scheme.
Source§

fn into_as<Dst>(self) -> Dst
where Self: Sized + Into<Dst>,

Convert the subject to a given type.
Source§

fn try_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + TryInto<Dst>,

Attempt to convert the subject to a given type.
Source§

fn value_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ValueInto<Dst>,

Attempt a value conversion of the subject to a given type.
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<Src> TryFrom<Src> for Src

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn try_from(src: Src) -> Result<Src, <Src as TryFrom<Src>>::Err>

Convert the given value into the subject type.
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<Src, Dst> TryInto<Dst> for Src
where Dst: TryFrom<Src>,

Source§

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.
Source§

fn try_into(self) -> Result<Dst, <Src as TryInto<Dst>>::Err>

Convert the subject into the destination type.
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<Src> ValueFrom<Src> for Src

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>

Convert the given value into an exactly equivalent representation.
Source§

impl<Src, Dst> ValueInto<Dst> for Src
where Dst: ValueFrom<Src>,

Source§

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.
Source§

fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>

Convert the subject into an exactly equivalent representation.