LogoAntiRaid

@antiraid-core/blob

API reference for @antiraid-core/blob

@antiraid-core/blob

Types

Blob

[[ A Blob is a special structure that is owned by Rust and can be used to e.g. avoid copying between Lua and Rust

When a Blob is passed into a DataStore/Rust, its contents may be moved to Rust leaving a empty Blob. `clone` can be used to avoid this. When this will happen is undefined.

This core primitive is not available in WASM contexts yet ]]

Raw Type
--[[
    A Blob is a special structure that is owned by Rust
    and can be used to e.g. avoid copying between Lua and Rust

    When a Blob is passed into a DataStore/Rust, its contents may be moved
    to Rust leaving a empty Blob. \`clone\` can be used to avoid this. When this
    will happen is undefined.

    This core primitive is not available in WASM contexts yet
]]
type Blob = {
	--- Converts the Blob to a buffer if there is enough memory available
	tobuffer: (self: Blob) -> buffer,

	--- Drains the Blob following which the Blob will be empty
	drain: (self: Blob) -> nil,

	--- Securely drains/"zeroizes" the Blob, following which the Blob will be empty
	zeroize: (self: Blob) -> nil,

	-- Metatable
	__len: (self: Blob) -> number
}
PropTypeDescription
tobuffer
(self) -> buffer
Converts the Blob to a buffer if there is enough memory available
drain
(self) -> nil
Drains the Blob following which the Blob will be empty
zeroize
(self) -> nil
Securely drains/'zeroizes' the Blob, following which the Blob will be empty
__len
(self) -> number
-

BlobTaker

Raw Type
type BlobTaker = buffer | string | Blob

Union with variants:

Variant 1

buffer

Variant 2

string

Variant 3

Blob

Last updated on