Struct PointObject

Source
pub struct PointObject<P, O> {
    pub points: Vec<P>,
    pub options: O,
}
Expand description

A struct representing a point object with associated points and options.

The PointObject struct is generic over the point type P and options type O.

Fields§

§points: Vec<P>

A vector of points of type P.

§options: O

Options of type O associated with the point object.

Implementations§

Source§

impl<P, O> PointObject<P, O>

Source

pub fn new(points: Vec<P>, options: O) -> Self

Creates a new PointObject with the given points and options.

§Parameters
  • points: A vector of points of type P.
  • options: Options of type O for the point object.
Source§

impl<P, O> PointObject<P, O>

Source

pub fn save(&self, path: &Path) -> Result<()>

Saves the PointObject to a file at the specified path.

§Parameters
  • path: The path to save the PointObject to.
§Returns

A Result indicating the success or failure of the save operation.

Source

pub fn load(path: &Path) -> Result<Self>

Loads a PointObject from a file at the specified path.

§Parameters
  • path: The path to load the PointObject from.
§Returns

Trait Implementations§

Source§

impl<P: Clone, O: Clone> Clone for PointObject<P, O>

Source§

fn clone(&self) -> PointObject<P, O>

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<P: Debug, O: Debug> Debug for PointObject<P, O>

Source§

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

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

impl<S: SizeSettings, P: FromStream<S>, O: FromStream<S>> FromStream<S> for PointObject<P, O>

Source§

fn from_stream<R: Read>(stream: &mut R) -> Result<Self>

Reads a value of this type from a stream and returns it. Returns an error on failure instead.
Source§

impl<P: Copy + Sub, O: SelectSettings<P>> Selectable for PointObject<P, O>
where P::Output: InnerSpace,

Source§

type Position = P

Source§

type Index = usize

Source§

fn add(&mut self, pos: P, index: Option<usize>) -> usize

Source§

fn get(&self, pos: P) -> Option<usize>

Source§

fn connect(&mut self, index: usize, selected: &[usize])

Source§

fn special(&mut self, index: usize, selected: &[usize])

Source§

impl<S: SizeSettings, P: ToStream<S>, O: ToStream<S>> ToStream<S> for PointObject<P, O>

Source§

fn to_stream<W: Write>(&self, stream: &mut W) -> Result<()>

Writes a value of this type to a stream. Return an error on failure.

Auto Trait Implementations§

§

impl<P, O> Freeze for PointObject<P, O>
where O: Freeze,

§

impl<P, O> RefUnwindSafe for PointObject<P, O>

§

impl<P, O> Send for PointObject<P, O>
where O: Send, P: Send,

§

impl<P, O> Sync for PointObject<P, O>
where O: Sync, P: Sync,

§

impl<P, O> Unpin for PointObject<P, O>
where O: Unpin, P: Unpin,

§

impl<P, O> UnwindSafe for PointObject<P, O>
where O: UnwindSafe, P: 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.