pub struct Cursor { /* private fields */ }
Implementations§
Source§impl Cursor
impl Cursor
Sourcepub fn new(session_id: i32, position: Position) -> Self
pub fn new(session_id: i32, position: Position) -> Self
Examples found in repository?
examples/manual_send.rs (line 12)
6fn main() {
7 let source = "test".to_string();
8
9 let sender = UdpSender::new(SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), 3333)).unwrap();
10
11 let cursors = vec![
12 Cursor::new(0, Position { x: 0., y: 0. }),
13 Cursor::new(1, Position { x: 0.5, y: 0.5 }),
14 ];
15
16 let cursor_bundle = OscEncoder::encode_cursor_bundle(
17 &cursors,
18 source,
19 0
20 );
21
22 sender.send_osc_packet(&OscPacket::Bundle(cursor_bundle)).expect("Sending OSC packet");
23}
Sourcepub fn with_motion(self, velocity: Velocity, acceleration: f32) -> Self
pub fn with_motion(self, velocity: Velocity, acceleration: f32) -> Self
pub fn get_session_id(&self) -> i32
pub fn get_position(&self) -> &Position
pub fn get_x_position(&self) -> f32
pub fn get_y_position(&self) -> f32
pub fn get_velocity(&self) -> &Velocity
pub fn get_x_velocity(&self) -> f32
pub fn get_y_velocity(&self) -> f32
pub fn get_acceleration(&self) -> f32
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Cursor
impl RefUnwindSafe for Cursor
impl Send for Cursor
impl Sync for Cursor
impl Unpin for Cursor
impl UnwindSafe for Cursor
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