| 1 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::opsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/::Derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#; |
| 2 | |
| 3 | use superrust-analyzer cargo svg 0.18.0 node/element/path/::Numberrust-analyzer cargo svg 0.18.0 node/element/path/Number#; |
| 4 | |
| 5 | /// Parameters of a command. |
| 6 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)] |
| 7 | pub struct Parametersrust-analyzer cargo svg 0.18.0 node/element/path/parameters/Parameters#(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Numberrust-analyzer cargo svg 0.18.0 node/element/path/Number#>); |
| 8 | |
| 9 | impl Derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref# for Parametersrust-analyzer cargo svg 0.18.0 node/element/path/parameters/Parameters# { |
| 10 | type Targetrust-analyzer cargo svg 0.18.0 node/element/path/parameters/impl#[Parameters][Deref]Target# = [Numberrust-analyzer cargo svg 0.18.0 node/element/path/Number#]; |
| 11 | |
| 12 | #[inline] |
| 13 | fn derefrust-analyzer cargo svg 0.18.0 node/element/path/parameters/impl#[Parameters][Deref]deref().(&self) -> &Selfrust-analyzer cargo svg 0.18.0 node/element/path/parameters/impl#[Parameters][Deref]::Targetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#Target# { |
| 14 | &self.0rust-analyzer cargo svg 0.18.0 node/element/path/parameters/Parameters#0. |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<Parametersrust-analyzer cargo svg 0.18.0 node/element/path/parameters/Parameters#> for Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# { |
| 19 | fn fromrust-analyzer cargo svg 0.18.0 node/element/path/parameters/impl#[String][`From<Parameters>`]from().(Parametersrust-analyzer cargo svg 0.18.0 node/element/path/parameters/Parameters#(inner): Parametersrust-analyzer cargo svg 0.18.0 node/element/path/parameters/Parameters#) -> Selfrust-analyzer cargo svg 0.18.0 node/element/path/parameters/impl#[String][`From<Parameters>`] { |
| 20 | inner |
| 21 | .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().() |
| 22 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|value| value.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()) |
| 23 | .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>() |
| 24 | .joinrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]join().(",") |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Numberrust-analyzer cargo svg 0.18.0 node/element/path/Number#>> for Parametersrust-analyzer cargo svg 0.18.0 node/element/path/parameters/Parameters# { |
| 29 | #[inline] |
| 30 | fn fromrust-analyzer cargo svg 0.18.0 node/element/path/parameters/impl#[Parameters][`From<Vec<f32>>`]from().(inner: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Numberrust-analyzer cargo svg 0.18.0 node/element/path/Number#>) -> Selfrust-analyzer cargo svg 0.18.0 node/element/path/parameters/impl#[Parameters][`From<Vec<f32>>`] { |
| 31 | Parametersrust-analyzer cargo svg 0.18.0 node/element/path/parameters/Parameters#(inner) |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<Parametersrust-analyzer cargo svg 0.18.0 node/element/path/parameters/Parameters#> for Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Numberrust-analyzer cargo svg 0.18.0 node/element/path/Number#> { |
| 36 | #[inline] |
| 37 | fn fromrust-analyzer cargo svg 0.18.0 node/element/path/parameters/impl#[`Vec<f32>`][`From<Parameters>`]from().(Parametersrust-analyzer cargo svg 0.18.0 node/element/path/parameters/Parameters#(inner): Parametersrust-analyzer cargo svg 0.18.0 node/element/path/parameters/Parameters#) -> Selfrust-analyzer cargo svg 0.18.0 node/element/path/parameters/impl#[`Vec<f32>`][`From<Parameters>`] { |
| 38 | inner |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | impl<'l> Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<&'l mut Parametersrust-analyzer cargo svg 0.18.0 node/element/path/parameters/Parameters#> for &'l mut Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Numberrust-analyzer cargo svg 0.18.0 node/element/path/Number#> { |
| 43 | #[inline] |
| 44 | fn fromrust-analyzer cargo svg 0.18.0 node/element/path/parameters/impl#[`&'l mut Vec<f32>`][`From<&'l mut Parameters>`]from().(Parametersrust-analyzer cargo svg 0.18.0 node/element/path/parameters/Parameters#(inner): &'l mut Parametersrust-analyzer cargo svg 0.18.0 node/element/path/parameters/Parameters#) -> Selfrust-analyzer cargo svg 0.18.0 node/element/path/parameters/impl#[`&'l mut Vec<f32>`][`From<&'l mut Parameters>`] { |
| 45 | inner |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | macro_rules! implementrust-analyzer cargo svg 0.18.0 node/element/path/parameters/implement! { |
| 50 | ($($primitive:ty,)*) => ( |
| 51 | $(impl From<$primitive> for Parameters { |
| 52 | #[inline] |
| 53 | fn from(inner: $primitive) -> Self { |
| 54 | Parameters(vec![inner as Number]) |
| 55 | } |
| 56 | })* |
| 57 | ); |
| 58 | } |
| 59 | |
| 60 | implementrust-analyzer cargo svg 0.18.0 node/element/path/parameters/implement!! { |
| 61 | i8, i16, i32, i64, isize, |
| 62 | u8, u16, u32, u64, usize, |
| 63 | f32, f64, |
| 64 | } |
| 65 | |
| 66 | macro_rules! implementrust-analyzer cargo svg 0.18.0 node/element/path/parameters/implement! { |
| 67 | (@express $e:expr) => ($e); |
| 68 | ($(($t:ident, $n:tt)),*) => ( |
| 69 | impl<$($t),*> From<($($t),*)> for Parameters |
| 70 | where |
| 71 | $($t: Into<Parameters>),* |
| 72 | { |
| 73 | fn from(inner: ($($t),*)) -> Self { |
| 74 | let mut result = vec![]; |
| 75 | $(result.append(&mut implement!(@express inner.$n).into().into());)* |
| 76 | Parameters(result) |
| 77 | } |
| 78 | } |
| 79 | ); |
| 80 | } |
| 81 | |
| 82 | implementrust-analyzer cargo svg 0.18.0 node/element/path/parameters/implement!! { (T0, 0), (T1, 1) } |
| 83 | implementrust-analyzer cargo svg 0.18.0 node/element/path/parameters/implement!! { (T0, 0), (T1, 1), (T2, 2) } |
| 84 | implementrust-analyzer cargo svg 0.18.0 node/element/path/parameters/implement!! { (T0, 0), (T1, 1), (T2, 2), (T3, 3) } |
| 85 | implementrust-analyzer cargo svg 0.18.0 node/element/path/parameters/implement!! { (T0, 0), (T1, 1), (T2, 2), (T3, 3), (T4, 4) } |
| 86 | implementrust-analyzer cargo svg 0.18.0 node/element/path/parameters/implement!! { (T0, 0), (T1, 1), (T2, 2), (T3, 3), (T4, 4), (T5, 5) } |
| 87 | implementrust-analyzer cargo svg 0.18.0 node/element/path/parameters/implement!! { (T0, 0), (T1, 1), (T2, 2), (T3, 3), (T4, 4), (T5, 5), (T6, 6) } |
| 88 | implementrust-analyzer cargo svg 0.18.0 node/element/path/parameters/implement!! { (T0, 0), (T1, 1), (T2, 2), (T3, 3), (T4, 4), (T5, 5), (T6, 6), (T7, 7) } |