DeclareField

Struct DeclareField 

Source
pub struct DeclareField<Name, Value>(pub Name, pub Value);
Expand description

Declares a single field within a struct. Renders as Name: Value.

Does not add attributes. If you want to use attributes for declaration purposes, you can use CanHaveAttributes::with_attributes on this field.

Tuple Fields§

§0: Name§1: Value

Trait Implementations§

Source§

impl<Name, Value> CanHaveAttributes for DeclareField<Name, Value>

Source§

fn with_attributes<Attr>(self, attr: Attr) -> WithAttributes<Attr, Self>

Adds attributes to this writable
Source§

impl<O, Name, Value> Writable<O> for DeclareField<Name, Value>
where O: Output, Name: Writable<O>, Value: Writable<O>,

Source§

async fn write_to(&self, o: &mut O) -> Result<(), O::Error>

Writes to the output. Returns the output’s error upon failure. Read more

Auto Trait Implementations§

§

impl<Name, Value> Freeze for DeclareField<Name, Value>
where Name: Freeze, Value: Freeze,

§

impl<Name, Value> RefUnwindSafe for DeclareField<Name, Value>
where Name: RefUnwindSafe, Value: RefUnwindSafe,

§

impl<Name, Value> Send for DeclareField<Name, Value>
where Name: Send, Value: Send,

§

impl<Name, Value> Sync for DeclareField<Name, Value>
where Name: Sync, Value: Sync,

§

impl<Name, Value> Unpin for DeclareField<Name, Value>
where Name: Unpin, Value: Unpin,

§

impl<Name, Value> UnwindSafe for DeclareField<Name, Value>
where Name: UnwindSafe, Value: 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 = 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.