[−][src]Function show_notes::e029::ffi::translate
pub(super) unsafe extern "C" fn translate(
point: *mut Point,
by_x: c_float,
by_y: c_float
)
An example of a C function we can call with an object.
You can use it in an unsafe
block like so:
ⓘThis example is not tested
let mut point = Point { x: 0.0, y: 0.0 }; unsafe { translate(&mut point, 12.3, 14.4); } assert_eq!(point, Point { x: 12.3, y: 14.4 });