Struct Instance

Source
pub struct Instance<T, U>(pub T, _);

Tuple Fields§

§0: T

Implementations§

Source§

impl<T, U> Instance<T, U>

Source

pub fn new(value: T) -> Self

Source§

impl<T: 'static, U: 'static> Instance<T, U>

Source

pub fn downcast_ref<D: Dyn + ?Sized>(v: &D) -> &T

Source

pub fn downcast_mut<D: Dyn + ?Sized>(v: &mut D) -> &mut T

Source

pub fn downcast<D: Dyn + ?Sized>(v: Box<D>) -> T

Trait Implementations§

Source§

impl<T: Add<Output = T>, U> Add for Instance<T, U>

Source§

type Output = Instance<T, U>

The resulting type after applying the + operator.
Source§

fn add(self, other: Self) -> Self

Performs the + operation. Read more
Source§

impl<T: AddAssign, U> AddAssign for Instance<T, U>

Source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
Source§

impl<T: Binary, U> Binary for Instance<T, U>

Source§

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

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

impl<T: BitAnd<Output = T>, U> BitAnd for Instance<T, U>

Source§

type Output = Instance<T, U>

The resulting type after applying the & operator.
Source§

fn bitand(self, other: Self) -> Self

Performs the & operation. Read more
Source§

impl<T: BitAndAssign, U> BitAndAssign for Instance<T, U>

Source§

fn bitand_assign(&mut self, other: Self)

Performs the &= operation. Read more
Source§

impl<T: BitOr<Output = T>, U> BitOr for Instance<T, U>

Source§

type Output = Instance<T, U>

The resulting type after applying the | operator.
Source§

fn bitor(self, other: Self) -> Self

Performs the | operation. Read more
Source§

impl<T: BitOrAssign, U> BitOrAssign for Instance<T, U>

Source§

fn bitor_assign(&mut self, other: Self)

Performs the |= operation. Read more
Source§

impl<T: BitXor<Output = T>, U> BitXor for Instance<T, U>

Source§

type Output = Instance<T, U>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, other: Self) -> Self

Performs the ^ operation. Read more
Source§

impl<T: BitXorAssign, U> BitXorAssign for Instance<T, U>

Source§

fn bitxor_assign(&mut self, other: Self)

Performs the ^= operation. Read more
Source§

impl<T: Clone, U> Clone for Instance<T, U>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug, U> Debug for Instance<T, U>

Source§

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

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

impl<T: Display, U> Display for Instance<T, U>

Source§

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

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

impl<T: Div<Output = T>, U> Div for Instance<T, U>

Source§

type Output = Instance<T, U>

The resulting type after applying the / operator.
Source§

fn div(self, other: Self) -> Self

Performs the / operation. Read more
Source§

impl<T: DivAssign, U> DivAssign for Instance<T, U>

Source§

fn div_assign(&mut self, other: Self)

Performs the /= operation. Read more
Source§

impl<T: Hash, U> Hash for Instance<T, U>

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<T: LowerExp, U> LowerExp for Instance<T, U>

Source§

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

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

impl<T: LowerHex, U> LowerHex for Instance<T, U>

Source§

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

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

impl<T: Mul<Output = T>, U> Mul for Instance<T, U>

Source§

type Output = Instance<T, U>

The resulting type after applying the * operator.
Source§

fn mul(self, other: Self) -> Self

Performs the * operation. Read more
Source§

impl<T: MulAssign, U> MulAssign for Instance<T, U>

Source§

fn mul_assign(&mut self, other: Self)

Performs the *= operation. Read more
Source§

impl<T: Neg<Output = T>, U> Neg for Instance<T, U>

Source§

type Output = Instance<T, U>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self

Performs the unary - operation. Read more
Source§

impl<T: Not<Output = T>, U> Not for Instance<T, U>

Source§

type Output = Instance<T, U>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self

Performs the unary ! operation. Read more
Source§

impl<T: Octal, U> Octal for Instance<T, U>

Source§

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

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

impl<T: Ord, U> Ord for Instance<T, U>

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<T: PartialEq, U> PartialEq for Instance<T, U>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: PartialOrd, U> PartialOrd for Instance<T, U>

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T: Rem<Output = T>, U> Rem for Instance<T, U>

Source§

type Output = Instance<T, U>

The resulting type after applying the % operator.
Source§

fn rem(self, other: Self) -> Self

Performs the % operation. Read more
Source§

impl<T: RemAssign, U> RemAssign for Instance<T, U>

Source§

fn rem_assign(&mut self, other: Self)

Performs the %= operation. Read more
Source§

impl<T: Shl<Output = T>, U> Shl for Instance<T, U>

Source§

type Output = Instance<T, U>

The resulting type after applying the << operator.
Source§

fn shl(self, other: Self) -> Self

Performs the << operation. Read more
Source§

impl<T: ShlAssign, U> ShlAssign for Instance<T, U>

Source§

fn shl_assign(&mut self, other: Self)

Performs the <<= operation. Read more
Source§

impl<T: Shr<Output = T>, U> Shr for Instance<T, U>

Source§

type Output = Instance<T, U>

The resulting type after applying the >> operator.
Source§

fn shr(self, other: Self) -> Self

Performs the >> operation. Read more
Source§

impl<T: ShrAssign, U> ShrAssign for Instance<T, U>

Source§

fn shr_assign(&mut self, other: Self)

Performs the >>= operation. Read more
Source§

impl<T: Sub<Output = T>, U> Sub for Instance<T, U>

Source§

type Output = Instance<T, U>

The resulting type after applying the - operator.
Source§

fn sub(self, other: Self) -> Self

Performs the - operation. Read more
Source§

impl<T: SubAssign, U> SubAssign for Instance<T, U>

Source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
Source§

impl<T: UpperExp, U> UpperExp for Instance<T, U>

Source§

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

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

impl<T: UpperHex, U> UpperHex for Instance<T, U>

Source§

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

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

impl<T: Eq, U> Eq for Instance<T, U>

Auto Trait Implementations§

§

impl<T, U> Freeze for Instance<T, U>
where T: Freeze,

§

impl<T, U> RefUnwindSafe for Instance<T, U>

§

impl<T, U> Send for Instance<T, U>
where T: Send, U: Send,

§

impl<T, U> Sync for Instance<T, U>
where T: Sync, U: Sync,

§

impl<T, U> Unpin for Instance<T, U>
where T: Unpin, U: Unpin,

§

impl<T, U> UnwindSafe for Instance<T, U>
where T: UnwindSafe, U: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Add for T
where T: Dyn + Add<Output = T>,

Source§

fn dyn_add(self: Box<T>, other: Box<dyn Any>) -> *mut ()

Source§

impl<T> AddAssign for T
where T: Dyn + AddAssign,

Source§

fn dyn_add_assign(&mut self, other: Box<dyn Any>)

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> BitAnd for T
where T: Dyn + BitAnd<Output = T>,

Source§

fn dyn_bitand(self: Box<T>, other: Box<dyn Any>) -> *mut ()

Source§

impl<T> BitAndAssign for T
where T: Dyn + BitAndAssign,

Source§

fn dyn_bitand_assign(&mut self, other: Box<dyn Any>)

Source§

impl<T> BitOr for T
where T: Dyn + BitOr<Output = T>,

Source§

fn dyn_bitor(self: Box<T>, other: Box<dyn Any>) -> *mut ()

Source§

impl<T> BitOrAssign for T
where T: Dyn + BitOrAssign,

Source§

fn dyn_bitor_assign(&mut self, other: Box<dyn Any>)

Source§

impl<T> BitXor for T
where T: Dyn + BitXor<Output = T>,

Source§

fn dyn_bitxor(self: Box<T>, other: Box<dyn Any>) -> *mut ()

Source§

impl<T> BitXorAssign for T
where T: Dyn + BitXorAssign,

Source§

fn dyn_bitxor_assign(&mut self, other: Box<dyn Any>)

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> Clone for T
where T: Clone,

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> Div for T
where T: Dyn + Div<Output = T>,

Source§

fn dyn_div(self: Box<T>, other: Box<dyn Any>) -> *mut ()

Source§

impl<T> DivAssign for T
where T: Dyn + DivAssign,

Source§

fn dyn_div_assign(&mut self, other: Box<dyn Any>)

Source§

impl<T> Dyn for T
where T: Any,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Source§

fn as_any_box(self: Box<T>) -> Box<dyn Any>

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> Mul for T
where T: Dyn + Mul<Output = T>,

Source§

fn dyn_mul(self: Box<T>, other: Box<dyn Any>) -> *mut ()

Source§

impl<T> MulAssign for T
where T: Dyn + MulAssign,

Source§

fn dyn_mul_assign(&mut self, other: Box<dyn Any>)

Source§

impl<T> Neg for T
where T: Dyn + Neg<Output = T>,

Source§

fn dyn_neg(self: Box<T>) -> *mut ()

Source§

impl<T> Not for T
where T: Dyn + Not<Output = T>,

Source§

fn dyn_not(self: Box<T>) -> *mut ()

Source§

impl<T> Ord for T
where T: Dyn + Ord,

Source§

fn dyn_cmp(&self, other: &(dyn Any + 'static)) -> Ordering

Source§

impl<T> PartialEq for T
where T: Dyn + PartialEq,

Source§

fn dyn_eq(&self, other: &(dyn Any + 'static)) -> bool

Source§

impl<T> PartialOrd for T
where T: Dyn + PartialOrd,

Source§

fn dyn_partial_cmp(&self, other: &(dyn Any + 'static)) -> Option<Ordering>

Source§

impl<T> Rem for T
where T: Dyn + Rem<Output = T>,

Source§

fn dyn_rem(self: Box<T>, other: Box<dyn Any>) -> *mut ()

Source§

impl<T> RemAssign for T
where T: Dyn + RemAssign,

Source§

fn dyn_rem_assign(&mut self, other: Box<dyn Any>)

Source§

impl<T> Shl for T
where T: Dyn + Shl<Output = T>,

Source§

fn dyn_shl(self: Box<T>, other: Box<dyn Any>) -> *mut ()

Source§

impl<T> ShlAssign for T
where T: Dyn + ShlAssign,

Source§

fn dyn_shl_assign(&mut self, other: Box<dyn Any>)

Source§

impl<T> Shr for T
where T: Dyn + Shr<Output = T>,

Source§

fn dyn_shr(self: Box<T>, other: Box<dyn Any>) -> *mut ()

Source§

impl<T> ShrAssign for T
where T: Dyn + ShrAssign,

Source§

fn dyn_shr_assign(&mut self, other: Box<dyn Any>)

Source§

impl<T> Sub for T
where T: Dyn + Sub<Output = T>,

Source§

fn dyn_sub(self: Box<T>, other: Box<dyn Any>) -> *mut ()

Source§

impl<T> SubAssign for T
where T: Dyn + SubAssign,

Source§

fn dyn_sub_assign(&mut self, other: Box<dyn Any>)

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 = 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.
Source§

impl<T> Eq for T
where T: Dyn + Eq,