Struct show_notes::e019::CCopyPoint
source · pub struct CCopyPoint {
x: f64,
y: f64,
z: f64,
}
Expand description
A struct with identical behavior to ANoCopyOrClonePoint
, except with Copy
.
Note that we have Clone
as well as Copy
here—we have to, since
Clone
is a supertrait for Copy
.
§Examples
Note that this is just like the non-compiling example in ANoCopyOrClonePoint
, but because
CCopyPoint
implements Copy
, the line which previously caused a compile
error now works without any issue.
let a_point = CCopyPoint::origin();
let copied_point = a_point;
println!("{:?}", a_point); // <- not a problem
println!("{:?}", copied_point)
Fields§
§x: f64
§y: f64
§z: f64
Implementations§
source§impl CCopyPoint
impl CCopyPoint
sourcepub fn origin() -> CCopyPoint
pub fn origin() -> CCopyPoint
Generate a point at 0, 0, 0
Trait Implementations§
source§impl Clone for CCopyPoint
impl Clone for CCopyPoint
source§fn clone(&self) -> CCopyPoint
fn clone(&self) -> CCopyPoint
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CCopyPoint
impl Debug for CCopyPoint
impl Copy for CCopyPoint
Auto Trait Implementations§
impl Freeze for CCopyPoint
impl RefUnwindSafe for CCopyPoint
impl Send for CCopyPoint
impl Sync for CCopyPoint
impl Unpin for CCopyPoint
impl UnwindSafe for CCopyPoint
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more