Instance Methodswift 6.0.1Swift

    load(fromByteOffset:as:)

    Returns a new instance of the given type, constructed from the raw memory at the specified offset.

    func load<T>(fromByteOffset offset: Int = 0, as type: T.Type) -> T

    Parameters

    offset

    The offset from this pointer, in bytes. offset must be nonnegative. The default is zero.

    type

    The type of the instance to create.

    Returns

    A new instance of type T, read from the raw bytes at offset. The returned instance is memory-managed and unassociated with the value in the memory referenced by this pointer.

    The memory at this pointer plus offset must be properly aligned for accessing T and initialized to T or another type that is layout compatible with T.

    Other members in extension

    Typealiases

    Type members

    Show obsolete interfaces (1)

    Hide obsolete interfaces

    Instance members

    Show obsolete interfaces (5)

    Hide obsolete interfaces