Struct tinychain::object::InstanceExt
source · [−]pub struct InstanceExt<T: Instance> { /* private fields */ }
Expand description
A user-defined instance, subclassing T
.
Implementations
sourceimpl<T: Instance> InstanceExt<T>
impl<T: Instance> InstanceExt<T>
sourcepub fn new(parent: T, class: InstanceClass) -> InstanceExt<T>
pub fn new(parent: T, class: InstanceClass) -> InstanceExt<T>
Construct a new instance of the given user-defined InstanceClass
.
sourcepub fn anonymous(
parent: T,
class: InstanceClass,
members: Map<State>
) -> InstanceExt<T>
pub fn anonymous(
parent: T,
class: InstanceClass,
members: Map<State>
) -> InstanceExt<T>
Construct a new instance of an anonymous class.
Trait Implementations
sourceimpl<T: Clone + Instance> Clone for InstanceExt<T>
impl<T: Clone + Instance> Clone for InstanceExt<T>
sourcefn clone(&self) -> InstanceExt<T>
fn clone(&self) -> InstanceExt<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T: Instance + Debug> Debug for InstanceExt<T>
impl<T: Instance + Debug> Debug for InstanceExt<T>
sourceimpl<T: Instance> Deref for InstanceExt<T>
impl<T: Instance> Deref for InstanceExt<T>
sourceimpl<T: Instance + Display> Display for InstanceExt<T>
impl<T: Instance + Display> Display for InstanceExt<T>
sourceimpl From<InstanceExt<State>> for Object
impl From<InstanceExt<State>> for Object
sourcefn from(instance: InstanceExt<State>) -> Object
fn from(instance: InstanceExt<State>) -> Object
Converts to this type from the input type.
sourceimpl<T: Instance> Instance for InstanceExt<T>
impl<T: Instance> Instance for InstanceExt<T>
sourceimpl<'en> IntoView<'en, Dir> for InstanceExt<State>
impl<'en> IntoView<'en, Dir> for InstanceExt<State>
type Txn = Txn
type View = InstanceView<'en>
sourcefn into_view<'async_trait>(
self,
txn: Txn
) -> Pin<Box<dyn Future<Output = TCResult<InstanceView<'en>>> + Send + 'async_trait>> where
Self: 'async_trait,
fn into_view<'async_trait>(
self,
txn: Txn
) -> Pin<Box<dyn Future<Output = TCResult<InstanceView<'en>>> + Send + 'async_trait>> where
Self: 'async_trait,
Return a View
which can be encoded with en::IntoStream
.
sourceimpl<T: Instance + Display> TryCastFrom<InstanceExt<T>> for Scalar where
Scalar: TryCastFrom<T>,
impl<T: Instance + Display> TryCastFrom<InstanceExt<T>> for Scalar where
Scalar: TryCastFrom<T>,
sourcefn can_cast_from(instance: &InstanceExt<T>) -> bool
fn can_cast_from(instance: &InstanceExt<T>) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(instance: InstanceExt<T>) -> Option<Self>
fn opt_cast_from(instance: InstanceExt<T>) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl<T: Instance + Display> TryCastFrom<InstanceExt<T>> for Value where
Value: TryCastFrom<T>,
impl<T: Instance + Display> TryCastFrom<InstanceExt<T>> for Value where
Value: TryCastFrom<T>,
sourcefn can_cast_from(instance: &InstanceExt<T>) -> bool
fn can_cast_from(instance: &InstanceExt<T>) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(instance: InstanceExt<T>) -> Option<Self>
fn opt_cast_from(instance: InstanceExt<T>) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
Auto Trait Implementations
impl<T> !RefUnwindSafe for InstanceExt<T>
impl<T> Send for InstanceExt<T>
impl<T> Sync for InstanceExt<T>
impl<T> Unpin for InstanceExt<T>
impl<T> !UnwindSafe for InstanceExt<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<F> Match for F
impl<F> Match for F
sourcefn matches<T>(&self) -> bool where
T: TryCastFrom<Self>,
fn matches<T>(&self) -> bool where
T: TryCastFrom<Self>,
Returns true
if self
can be cast into the target type T
.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<F, T> TryCastFrom<F> for T where
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for T where
T: CastFrom<F>,
sourcefn can_cast_from(&F) -> bool
fn can_cast_from(&F) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(f: F) -> Option<T>
fn opt_cast_from(f: F) -> Option<T>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl<F, T> TryCastInto<T> for F where
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for F where
T: TryCastFrom<F>,
sourcefn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if self
can be cast into T
.
sourcefn opt_cast_into(self) -> Option<T>
fn opt_cast_into(self) -> Option<T>
Returns Some(T)
if self
can be cast into T
, otherwise None
.
sourcefn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
Returns Ok(T)
if self
can be cast into T
, otherwise calls on_err
.
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more