pub struct DartNullSafety;Expand description
Null safety helper expressions.
Implementations§
Source§impl DartNullSafety
impl DartNullSafety
Sourcepub fn assert_non_null(expr: DartExpr) -> DartExpr
pub fn assert_non_null(expr: DartExpr) -> DartExpr
expr! — null assertion operator.
Sourcepub fn coalesce(expr: DartExpr, fallback: DartExpr) -> DartExpr
pub fn coalesce(expr: DartExpr, fallback: DartExpr) -> DartExpr
expr ?? fallback — null coalescing.
Sourcepub fn safe_field(expr: DartExpr, field: impl Into<String>) -> DartExpr
pub fn safe_field(expr: DartExpr, field: impl Into<String>) -> DartExpr
expr?.field — null-safe field access.
Sourcepub fn guard_not_null(var: &str, _ty: DartType) -> DartStmt
pub fn guard_not_null(var: &str, _ty: DartType) -> DartStmt
Emit a null check guard statement.
Sourcepub fn nullable_decl(ty: DartType, name: &str) -> DartStmt
pub fn nullable_decl(ty: DartType, name: &str) -> DartStmt
T? x = null; — nullable variable declaration.
Auto Trait Implementations§
impl Freeze for DartNullSafety
impl RefUnwindSafe for DartNullSafety
impl Send for DartNullSafety
impl Sync for DartNullSafety
impl Unpin for DartNullSafety
impl UnsafeUnpin for DartNullSafety
impl UnwindSafe for DartNullSafety
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more