Struct Instance

Source
pub struct Instance<'v, I, T = ()>
where I: ?Sized + Interface,
{ /* private fields */ }

Implementations§

Source§

impl<I> Instance<'_, I>
where I: Interface + ?Sized,

Source

pub fn new_owned<'a, T>(value: T) -> Instance<'a, I>
where T: InterfaceMark<I> + Object + Send + Sync + 'static,

Source

pub fn new_borrowed<T>(value: &T) -> Instance<'_, I>
where T: InterfaceMark<I> + Object + Send + Sync + 'static,

Trait Implementations§

Source§

impl<I> OutputTypeName for Instance<'_, I>
where I: Interface + 'static + ?Sized,

Source§

impl<I> Register for Instance<'_, I, ()>
where I: ?Sized + Interface + 'static,

Source§

impl<I, T> Register for Instance<'_, I, T>
where I: ?Sized + Interface + 'static + RegisterInstance<I, T>, T: Object + 'static + Send + Sync,

Source§

impl<'a, I> ResolveOwned<'a> for Instance<'a, I>
where I: ?Sized + Interface,

Source§

impl<I> TypeName for Instance<'_, I>
where I: Interface + 'static + ?Sized,

Source§

fn get_type_name() -> Cow<'static, str>

Auto Trait Implementations§

§

impl<'v, I, T> Freeze for Instance<'v, I, T>
where I: ?Sized,

§

impl<'v, I, T = ()> !RefUnwindSafe for Instance<'v, I, T>

§

impl<'v, I, T> Send for Instance<'v, I, T>
where I: Send + ?Sized, T: Send,

§

impl<'v, I, T> Sync for Instance<'v, I, T>
where I: Sync + ?Sized, T: Sync,

§

impl<'v, I, T> Unpin for Instance<'v, I, T>
where I: Unpin + ?Sized, T: Unpin,

§

impl<'v, I, T = ()> !UnwindSafe for Instance<'v, I, T>

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

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<'a, T> Resolve<'a> for T
where T: ResolveOwned<'a>,

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.