Skip to main content

LocationData

Struct LocationData 

Source
pub struct LocationData<T: Clone> {
    pub position: CartesianPosition,
    pub lat: f64,
    pub lng: f64,
    pub data: T,
}

Fields§

§position: CartesianPosition§lat: f64§lng: f64§data: T

Implementations§

Source§

impl<T: Clone> LocationData<T>

Source

pub fn new(lat: f64, lng: f64, data: T) -> Self

Examples found in repository?
examples/construct_tree.rs (line 5)
3fn main() {
4    let data = vec![
5        LocationData::new(42.358, -71.064, "Boston"),
6        LocationData::new(42.732, -73.693, "Troy"),
7        LocationData::new(40.664, -73.939, "New York"),
8        LocationData::new(25.788, -80.224, "Miami"),
9        LocationData::new(51.507, -0.128, "London"),
10        LocationData::new(48.857, 2.351, "Paris"),
11        LocationData::new(48.208, 16.373, "Vienna"),
12        LocationData::new(41.900, 12.500, "Rome"),
13        LocationData::new(39.914, 116.392, "Beijing"),
14        LocationData::new(22.278, 114.159, "Hong Kong"),
15        LocationData::new(37.567, 126.978, "Seoul"),
16        LocationData::new(35.690, 139.692, "Tokyo"),
17    ];
18    let tree = build_tree(data);
19    println!("{:#?}", tree);
20}

Trait Implementations§

Source§

impl<T: Clone + Clone> Clone for LocationData<T>

Source§

fn clone(&self) -> LocationData<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Copy + Clone> Copy for LocationData<T>

Source§

impl<T: Debug + Clone> Debug for LocationData<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Default + Clone> Default for LocationData<T>

Source§

fn default() -> LocationData<T>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T> Freeze for LocationData<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for LocationData<T>
where T: RefUnwindSafe,

§

impl<T> Send for LocationData<T>
where T: Send,

§

impl<T> Sync for LocationData<T>
where T: Sync,

§

impl<T> Unpin for LocationData<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for LocationData<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for LocationData<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.