Skip to main content

Mojo struct

NonNullPointer

@register_passable(trivial) struct NonNullPointer[dtype_: DType]

Fields

  • ptr (UnsafePointer[Scalar[NonNullPointer[dtype_].dtype], ImmutAnyOrigin]):

Implemented traits

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDestructible, Movable, OptionalPointer, RegisterPassable, TrivialRegisterPassable

comptime members

__copyinit__is_trivial

comptime __copyinit__is_trivial = True

__del__is_trivial

comptime __del__is_trivial = True

__moveinit__is_trivial

comptime __moveinit__is_trivial = True

dtype

comptime dtype = dtype_

is_null

comptime is_null = False

Methods

__init__

__init__(ptr: UnsafePointer[Scalar[NonNullPointer[dtype_].dtype], ImmutAnyOrigin]) -> Self

__init__(ptr: DeviceBuffer[NonNullPointer[dtype_].dtype]) -> Self

value

value(self) -> UnsafePointer[Scalar[NonNullPointer[dtype_].dtype], ImmutAnyOrigin]

Returns:

UnsafePointer

Was this page helpful?