Skip to main content

SetAttr

Struct SetAttr 

Source
pub struct SetAttr<A = i32> {
    pub size: Range<A>,
    pub representation: Option<String>,
}

Fields§

§size: Range<A>§representation: Option<String>

Optional user-facing representation preference (short name), e.g. "packed".

Written in Essence as set (representation packed) of …. When present, representation selection heuristics default to this representation if it is applicable.

Implementations§

Source§

impl<A> SetAttr<A>

Source

pub fn new(size: Range<A>) -> Self

Source

pub fn new_min_max_size(min: A, max: A) -> Self

Source

pub fn new_min_size(min: A) -> Self

Source

pub fn new_max_size(max: A) -> Self

Source

pub fn new_size(sz: A) -> Self

Source

pub fn with_representation(self, name: impl Into<String>) -> Self

Set the representation preference (Essence short name), returning the updated attributes.

Source§

impl SetAttr<IntVal>

Trait Implementations§

Source§

impl<A: Clone> Clone for SetAttr<A>

Source§

fn clone(&self) -> SetAttr<A>

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<A: Debug> Debug for SetAttr<A>

Source§

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

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

impl<A> Default for SetAttr<A>

Source§

fn default() -> Self

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

impl<'de, A> Deserialize<'de> for SetAttr<A>
where A: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<A: Display> Display for SetAttr<A>

Source§

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

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

impl<A: Eq> Eq for SetAttr<A>

Source§

impl From<SetAttr> for SetAttr<IntVal>

Source§

fn from(val: SetAttr<i32>) -> Self

Converts to this type from the input type.
Source§

impl<B, C> FuncMap<B, C> for SetAttr<B>
where Range<B>: FuncMap<B, C, TypeParam<0usize>, Output = Range<C>>, Option<String>: Sized,

Source§

type Output = SetAttr<C>

The output type of the functorial mapping Read more
Source§

fn func_map<F>(self, f: F) -> Self::Output
where F: FnMut(B) -> C,

Applies the closure f to self in a functorial way
§

fn func_map_over<Q, F>(self, f: F) -> Self::Output
where F: FnMut(A) -> B, Q: FuncMarker<P>,

Applies the closure f to self in a functorial way, allowing explicit specification of the marker type P Read more
Source§

impl<A: Hash> Hash for SetAttr<A>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<A: PartialEq> PartialEq for SetAttr<A>

Source§

fn eq(&self, other: &SetAttr<A>) -> bool

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

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

Inequality operator !=. Read more
Source§

impl<A> Quine for SetAttr<A>
where A: Quine,

Source§

impl<A> Serialize for SetAttr<A>
where A: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<A: PartialEq> StructuralPartialEq for SetAttr<A>

Source§

impl TryFrom<SetAttr<IntVal>> for SetAttr<i32>

Source§

type Error = DomainOpError

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

fn try_from(val: SetAttr<IntVal>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<B, C> TryFuncMap<B, C> for SetAttr<B>
where Range<B>: TryFuncMap<B, C, TypeParam<0usize>, Output = Range<C>>, Option<String>: Sized,

Source§

type Output = SetAttr<C>

The output type of the functorial mapping Read more
Source§

fn try_func_map<E, F>(self, f: F) -> Result<Self::Output, E>
where F: FnMut(B) -> Result<C, E>,

Tries to apply the closure f to self in a functorial way Read more
§

fn try_func_map_over<Q, E, F>(self, f: F) -> Result<Self::Output, E>
where F: FnMut(A) -> Result<B, E>, Q: FuncMarker<P>,

Tries to apply the closure f to self in a functorial way, allowing explicit specification of the marker type P Read more

Auto Trait Implementations§

§

impl<A> Freeze for SetAttr<A>
where Range<A>: Freeze,

§

impl<A> RefUnwindSafe for SetAttr<A>
where Range<A>: RefUnwindSafe,

§

impl<A> Send for SetAttr<A>
where Range<A>: Send,

§

impl<A> Sync for SetAttr<A>
where Range<A>: Sync,

§

impl<A> Unpin for SetAttr<A>
where Range<A>: Unpin,

§

impl<A> UnsafeUnpin for SetAttr<A>
where Range<A>: UnsafeUnpin,

§

impl<A> UnwindSafe for SetAttr<A>
where Range<A>: 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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T, A> IntoAst<A> for T
where T: Into<A>, A: Ast,

§

fn into_ast(self, _a: &A) -> A

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more

Layout§

Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.