Struct rslint_parser::ast::TsPredicate [−][src]
pub struct TsPredicate { /* fields omitted */ }
Expand description
A type guard which performs a runtime check to guarantee the type of something in a scope
function isFish(pet: Fish | Bird): pet is Fish {
return (pet as Fish).swim !== undefined;
}
It could also be an assertion function:
function check(cond: any): asserts condition { /* */ }
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions https://www.typescriptlang.org/docs/handbook/advanced-types.html#user-defined-type-guards
Implementations
Trait Implementations
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for TsPredicate
impl Send for TsPredicate
impl Sync for TsPredicate
impl Unpin for TsPredicate
impl UnwindSafe for TsPredicate
Blanket Implementations
Mutably borrows from an owned value. Read more
Whether this implementor has acknowledged the 1.1.0 update to
unerase
’s documented implementation requirements. Read more