Skip to main content

Records

Struct Records 

Source
pub struct Records<T>(/* private fields */);
Expand description

Records of T, by the name of what each is of.

Implementations§

Source§

impl<T> Records<T>

Source

pub fn add(&mut self, name: impl Into<String>, record: T) -> GeopResult<()>

Records record under name. Fails, leaving the records as they are, if there is one of that name already.

Source

pub fn insert(&mut self, name: impl Into<String>, record: T)

Records record under name, in place of what was.

Source

pub fn remove(&mut self, name: &str) -> Option<T>

Takes the record of name out, if there is one: what it was of is gone.

Source

pub fn get(&self, name: &str) -> Option<&T>

The record of name, if there is one.

Source

pub fn iter(&self) -> impl Iterator<Item = (&str, &T)>

Every record, by name, in the order of the names.

Trait Implementations§

Source§

impl<T: Clone> Clone for Records<T>

Source§

fn clone(&self) -> Records<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: Debug> Debug for Records<T>

Source§

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

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

impl<T> Default for Records<T>

Source§

fn default() -> Self

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

impl<T: PartialEq> PartialEq for Records<T>

Source§

fn eq(&self, other: &Records<T>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<T: PartialEq> StructuralPartialEq for Records<T>

Source§

impl<T: PartialEq + 'static> Target for Records<T>

Every step that makes such an entity adds to them.

Source§

const CHAIN: bool = true

Whether several steps may produce a target of this type, each from what the steps before left (see crate::reader::Reader::previous): the model, the datums, the parameters’ values, the listings — what a program accumulates. A target that is not a chain — a sketch, a placed part — has one producer, and a second is an error naming both.
Source§

const KEEPER: Option<Keeper<Self>> = None

How its values are written to be kept between processes (see crate::kept): none for a target made again in every process — one that is cheap to make, or holds what cannot be written.

Auto Trait Implementations§

§

impl<T> Freeze for Records<T>

§

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

§

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

§

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

§

impl<T> Unpin for Records<T>

§

impl<T> UnsafeUnpin for Records<T>

§

impl<T> UnwindSafe for Records<T>
where T: RefUnwindSafe,

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.