[−][src]Struct hyperbole::field::Field
A named value where the name is lifted to the type level, analagous to a struct field.
This struct is intended to be named and instantiated via the f! or r! / R! macros.
For convenience, Field<T>
implements Deref and DerefMut for T
, as well as a number of
fundamental traits like Clone, Debug, etc. Consider it a smart pointer to a T
.
Examples
use hyperbole::f; let mut field = f![foo = "neat".to_owned()]; assert_eq!(4, field.len()); // Deref<Target = String> field.push('o'); // DerefMut assert_eq!("neato", format!("{}", field)); // Display assert_eq!(field, field.clone()); // Clone assert_eq!("foo", field.name());
Implementations
impl<T, const NAME: &'static str> Field<T, NAME>
[src]
pub const fn new(inner: T) -> Self
[src]
Returns a new field.
pub fn into_inner(self) -> T
[src]
Extracts the field's inner value.
pub const NAME: &'static str
[src]
The field's name.
pub const fn name(&self) -> &'static str
[src]
The field's name.
Trait Implementations
impl<T: Clone, const NAME: &'static str> Clone for Field<T, NAME>
[src]
impl<T: Copy, const NAME: &'static str> Copy for Field<T, NAME>
[src]
impl<T: Debug, const NAME: &'static str> Debug for Field<T, NAME>
[src]
impl<T, const NAME: &'static str> Deref for Field<T, NAME>
[src]
impl<T, const NAME: &'static str> DerefMut for Field<T, NAME>
[src]
impl<'de, T: Deserialize<'de>, const NAME: &'static str> Deserialize<'de> for Field<T, NAME>
[src]
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
[src]
impl<T: Display, const NAME: &'static str> Display for Field<T, NAME>
[src]
impl<T: Eq, const NAME: &'static str> Eq for Field<T, NAME>
[src]
impl<T, const NAME: &'static str> From<T> for Field<T, NAME>
[src]
impl<T: FromStr, const NAME: &'static str> FromStr for Field<T, NAME>
[src]
type Err = T::Err
The associated error which can be returned from parsing.
fn from_str(input: &str) -> Result<Self, Self::Err>
[src]
impl<T: Hash, const NAME: &'static str> Hash for Field<T, NAME>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: Ord, const NAME: &'static str> Ord for Field<T, NAME>
[src]
fn cmp(&self, other: &Field<T, NAME>) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<T: PartialEq, const NAME: &'static str> PartialEq<Field<T, NAME>> for Field<T, NAME>
[src]
impl<T: PartialOrd, const NAME: &'static str> PartialOrd<Field<T, NAME>> for Field<T, NAME>
[src]
fn partial_cmp(&self, other: &Field<T, NAME>) -> Option<Ordering>
[src]
fn lt(&self, other: &Field<T, NAME>) -> bool
[src]
fn le(&self, other: &Field<T, NAME>) -> bool
[src]
fn gt(&self, other: &Field<T, NAME>) -> bool
[src]
fn ge(&self, other: &Field<T, NAME>) -> bool
[src]
impl<T: Reply, const NAME: &'static str> Reply for Field<T, NAME>
[src]
fn into_response(self) -> Response
[src]
fn with_status(self, code: StatusCode) -> Response
[src]
fn with_header<H: Header>(self, header: H) -> Response
[src]
impl<T: Serialize, const NAME: &'static str> Serialize for Field<T, NAME>
[src]
impl<T, const NAME: &'static str> StructuralEq for Field<T, NAME>
[src]
impl<T, const NAME: &'static str> StructuralPartialEq for Field<T, NAME>
[src]
Auto Trait Implementations
impl<T, const NAME: &'static str> RefUnwindSafe for Field<T, NAME> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, const NAME: &'static str> Send for Field<T, NAME> where
T: Send,
T: Send,
impl<T, const NAME: &'static str> Sync for Field<T, NAME> where
T: Sync,
T: Sync,
impl<T, const NAME: &'static str> Unpin for Field<T, NAME> where
T: Unpin,
T: Unpin,
impl<T, const NAME: &'static str> UnwindSafe for Field<T, NAME> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
[src]
type Remainder = Choices
pub fn subset(
self
) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>
[src]
self
) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<!> for T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U, I> LiftInto<U, I> for T where
U: LiftFrom<T, I>,
[src]
U: LiftFrom<T, I>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<Source> Sculptor<HNil, HNil> for Source
[src]
type Remainder = Source
pub fn sculpt(self) -> (HNil, <Source as Sculptor<HNil, HNil>>::Remainder)
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,