[−][src]Trait abi_stable::abi_stability::extra_checks::ForExtraChecksImplementor
An extension trait for ExtraChecks
implementors.
Provided methods
fn downcast_with_layout<F, R, E>(
layout_containing_other: &'static TypeLayout,
checker: TypeCheckerMut,
f: F
) -> RResult<R, ExtraChecksError> where
Self: 'static,
F: FnOnce(&Self, TypeCheckerMut) -> Result<R, E>,
E: Send + Sync + ErrorTrait + 'static,
layout_containing_other: &'static TypeLayout,
checker: TypeCheckerMut,
f: F
) -> RResult<R, ExtraChecksError> where
Self: 'static,
F: FnOnce(&Self, TypeCheckerMut) -> Result<R, E>,
E: Send + Sync + ErrorTrait + 'static,
Allows one to access the unerased type of the ExtraChecks trait object
within layout_containing_other
.
Returns
-
ROk(_): If
other
could be unerased toSelf
,andf
did not return any errors. -
RErr(ExtraChecksError::NoneExtraChecks): If
layout_containing_other
does not contain an ExtraChecks trait object. -
RErr(ExtraChecksError::TypeChecker): If there is an error while type checking.
-
RErr(ExtraChecksError::ExtraChecks(_)): If there is an custom error within the function.
fn downcast_with_object<F, R, E>(
other: ExtraChecksRef,
checker: TypeCheckerMut,
f: F
) -> RResult<R, ExtraChecksError> where
F: FnOnce(&Self, TypeCheckerMut) -> Result<R, E>,
E: Send + Sync + ErrorTrait + 'static,
other: ExtraChecksRef,
checker: TypeCheckerMut,
f: F
) -> RResult<R, ExtraChecksError> where
F: FnOnce(&Self, TypeCheckerMut) -> Result<R, E>,
E: Send + Sync + ErrorTrait + 'static,
Allows one to access the unerased type of the other
trait object .
If the closure returns an ExtraChecksError
,it'll be returned unmodified and unwrapped.
Returns
-
ROk(_): If
other
could be unerased toSelf
,andf
did not return any errors. -
RErr(ExtraChecksError::TypeChecker): If there is an error while type checking.
-
RErr(ExtraChecksError::ExtraChecks(_)): If there is an custom error within the function.
Implementors
impl<This: ?Sized> ForExtraChecksImplementor for This where
This: StableAbi + ExtraChecks,
[src]
This: StableAbi + ExtraChecks,