pub struct Coord {
pub x: f64,
pub y: f64,
}
use coord2d::*;
fn main () {
let a: coords::Coord = new_coord!(1, 2.0);
let ve: Vec<f64> = a.to_vec();
println!("{:?}", ve);
}
use coord2d::*;
fn main () {
let a: coords::Coord = new_coord!(1, 2.0);
let tu: (f64, f64) = a.to_tuple();
println!("{:?}", tu);
}
use coord2d::*;
fn main () {
let a: coords::Coord = new_coord!(1, 2.0);
let (x, y) = a.split();
println!("{}, {}", x , y);
}
use coord2d::*;
fn main () {
let a: coords::Coord = new_coord!(1, 2.0);
let b: coords::Coord = new_coord!(0.4, 3.3);
let sum:coords::Coord = a + b;
println!("{:?}", sum);
}
The resulting type after applying the +
operator.
Formats the value using the given formatter. Read more
use coord2d::*;
fn main () {
let a: coords::Coord = new_coord!(1, 2.0);
let b: coords::Coord = new_coord!(0.4, 3.3);
let div:coords::Coord = a / b;
println!("{:?}", div);
}
The resulting type after applying the /
operator.
use coord2d::*;
fn main () {
let a: coords::Coord = new_coord!(1, 2.0);
let b: coords::Coord = new_coord!(0.4, 3.3);
let mul:coords::Coord = a * b;
println!("{:?}", mul);
}
The resulting type after applying the *
operator.
use coord2d::*;
fn main () {
let a: coords::Coord = new_coord!(1, 2.0);
let b: coords::Coord = new_coord!(0.4, 3.3);
let sub:coords::Coord = a - b;
println!("{:?}", sub);
}
The resulting type after applying the -
operator.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
[src]
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.