Skip to main content

RecordShape

Struct RecordShape 

Source
pub struct RecordShape { /* private fields */ }
Expand description

A record declaration: its name and its fields in declaration order.

Implementations§

Source§

impl RecordShape

Source

pub fn new<'a>( name: &str, fields: impl IntoIterator<Item = &'a str>, ) -> Arc<Self> ⓘ

Returns the shape of the record name declaring fields, in order.

Source

pub fn name(&self) -> &str

Returns the type’s declared name.

Source

pub fn fields(&self) -> impl ExactSizeIterator<Item = &str>

Returns the field names, in declaration order.

Source

pub fn field(&self, index: usize) -> Option<&str>

Returns the name of the field at index, counted from 0 in declaration order.

Trait Implementations§

Source§

impl Debug for RecordShape

Source§

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

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

impl Eq for RecordShape

Source§

impl PartialEq for RecordShape

Source§

fn eq(&self, other: &Self) -> bool

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RecordShape

Auto Trait Implementations§

§

impl Forget for RecordShape

§

impl Freeze for RecordShape
where *const ArcInner<str> is !null: Freeze, PhantomData<ArcInner<str>>: Freeze, *const [Arc<str>] is !null: Freeze, PhantomData<[Arc<str>]>: Freeze,

§

impl Move for RecordShape

§

impl RefUnwindSafe for RecordShape

§

impl Send for RecordShape
where Arc<str>: Send, BoxRaw<[Arc<str>]>: Send,

§

impl Sync for RecordShape
where Arc<str>: Sync, BoxRaw<[Arc<str>]>: Sync,

§

impl Unpin for RecordShape
where Arc<str>: Unpin, Box<[Arc<str>]>: Unpin,

§

impl UnsafeUnpin for RecordShape
where *const ArcInner<str> is !null: UnsafeUnpin, PhantomData<ArcInner<str>>: UnsafeUnpin, *const [Arc<str>] is !null: UnsafeUnpin, PhantomData<[Arc<str>]>: UnsafeUnpin,

§

impl UnwindSafe for RecordShape
where Arc<str>: UnwindSafe, BoxRaw<[Arc<str>]>: 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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.