Struct byondapi_sys::RawByondApi

source ·
pub struct RawByondApi {
Show 47 fields pub Byond_LastError: unsafe extern "C-unwind" fn() -> *const c_char, pub Byond_GetVersion: unsafe extern "C-unwind" fn(version: *mut u4c, build: *mut u4c), pub Byond_GetDMBVersion: unsafe extern "C-unwind" fn() -> u4c, pub ByondValue_Clear: unsafe extern "C-unwind" fn(v: *mut CByondValue), pub ByondValue_Type: unsafe extern "C-unwind" fn(v: *const CByondValue) -> ByondValueType, pub ByondValue_IsNull: unsafe extern "C-unwind" fn(v: *const CByondValue) -> bool, pub ByondValue_IsNum: unsafe extern "C-unwind" fn(v: *const CByondValue) -> bool, pub ByondValue_IsStr: unsafe extern "C-unwind" fn(v: *const CByondValue) -> bool, pub ByondValue_IsList: unsafe extern "C-unwind" fn(v: *const CByondValue) -> bool, pub ByondValue_IsTrue: unsafe extern "C-unwind" fn(v: *const CByondValue) -> bool, pub ByondValue_GetNum: unsafe extern "C-unwind" fn(v: *const CByondValue) -> f32, pub ByondValue_GetRef: unsafe extern "C-unwind" fn(v: *const CByondValue) -> u4c, pub ByondValue_SetNum: unsafe extern "C-unwind" fn(v: *mut CByondValue, f: f32), pub ByondValue_SetStr: unsafe extern "C-unwind" fn(v: *mut CByondValue, str_: *const c_char), pub ByondValue_SetRef: unsafe extern "C-unwind" fn(v: *mut CByondValue, type_: ByondValueType, ref_: u4c), pub ByondValue_Equals: unsafe extern "C-unwind" fn(a: *const CByondValue, b: *const CByondValue) -> bool, pub Byond_ThreadSync: unsafe extern "C-unwind" fn(callback: ByondCallback, data: *mut c_void, block: bool) -> CByondValue, pub Byond_GetStrId: unsafe extern "C-unwind" fn(str_: *const c_char) -> u4c, pub Byond_AddGetStrId: unsafe extern "C-unwind" fn(str_: *const c_char) -> u4c, pub Byond_ReadVar: unsafe extern "C-unwind" fn(loc: *const CByondValue, varname: *const c_char, result: *mut CByondValue) -> bool, pub Byond_ReadVarByStrId: unsafe extern "C-unwind" fn(loc: *const CByondValue, varname: u4c, result: *mut CByondValue) -> bool, pub Byond_WriteVar: unsafe extern "C-unwind" fn(loc: *const CByondValue, varname: *const c_char, val: *const CByondValue) -> bool, pub Byond_WriteVarByStrId: unsafe extern "C-unwind" fn(loc: *const CByondValue, varname: u4c, val: *const CByondValue) -> bool, pub Byond_CreateList: unsafe extern "C-unwind" fn(result: *mut CByondValue) -> bool, pub Byond_ReadList: unsafe extern "C-unwind" fn(loc: *const CByondValue, list: *mut CByondValue, len: *mut u4c) -> bool, pub Byond_WriteList: unsafe extern "C-unwind" fn(loc: *const CByondValue, list: *const CByondValue, len: u4c) -> bool, pub Byond_ReadListAssoc: unsafe extern "C-unwind" fn(loc: *const CByondValue, list: *mut CByondValue, len: *mut u4c) -> bool, pub Byond_ReadListIndex: unsafe extern "C-unwind" fn(loc: *const CByondValue, idx: *const CByondValue, result: *mut CByondValue) -> bool, pub Byond_WriteListIndex: unsafe extern "C-unwind" fn(loc: *const CByondValue, idx: *const CByondValue, val: *const CByondValue) -> bool, pub Byond_ReadPointer: unsafe extern "C-unwind" fn(ptr: *const CByondValue, result: *mut CByondValue) -> bool, pub Byond_WritePointer: unsafe extern "C-unwind" fn(ptr: *const CByondValue, val: *const CByondValue) -> bool, pub Byond_CallProc: unsafe extern "C-unwind" fn(src: *const CByondValue, name: *const c_char, arg: *const CByondValue, arg_count: u4c, result: *mut CByondValue) -> bool, pub Byond_CallProcByStrId: unsafe extern "C-unwind" fn(src: *const CByondValue, name: u4c, arg: *const CByondValue, arg_count: u4c, result: *mut CByondValue) -> bool, pub Byond_CallGlobalProc: unsafe extern "C-unwind" fn(name: *const c_char, arg: *const CByondValue, arg_count: u4c, result: *mut CByondValue) -> bool, pub Byond_CallGlobalProcByStrId: unsafe extern "C-unwind" fn(name: u4c, arg: *const CByondValue, arg_count: u4c, result: *mut CByondValue) -> bool, pub Byond_ToString: unsafe extern "C-unwind" fn(src: *const CByondValue, buf: *mut c_char, buflen: *mut u4c) -> bool, pub Byond_Block: unsafe extern "C-unwind" fn(corner1: *const CByondXYZ, corner2: *const CByondXYZ, list: *mut CByondValue, len: *mut u4c) -> bool, pub Byond_Length: unsafe extern "C-unwind" fn(src: *const CByondValue, result: *mut CByondValue) -> bool, pub Byond_LocateIn: unsafe extern "C-unwind" fn(type_: *const CByondValue, list: *const CByondValue, result: *mut CByondValue) -> bool, pub Byond_LocateXYZ: unsafe extern "C-unwind" fn(xyz: *const CByondXYZ, result: *mut CByondValue) -> bool, pub Byond_New: unsafe extern "C-unwind" fn(type_: *const CByondValue, arg: *const CByondValue, arg_count: u4c, result: *mut CByondValue) -> bool, pub Byond_NewArglist: unsafe extern "C-unwind" fn(type_: *const CByondValue, arglist: *const CByondValue, result: *mut CByondValue) -> bool, pub Byond_Refcount: unsafe extern "C-unwind" fn(src: *const CByondValue, result: *mut u4c) -> bool, pub Byond_XYZ: unsafe extern "C-unwind" fn(src: *const CByondValue, xyz: *mut CByondXYZ) -> bool, pub ByondValue_IncRef: unsafe extern "C-unwind" fn(src: *const CByondValue), pub ByondValue_DecRef: unsafe extern "C-unwind" fn(src: *const CByondValue), pub Byond_TestRef: unsafe extern "C-unwind" fn(src: *mut CByondValue) -> bool, /* private fields */
}

Fields§

§Byond_LastError: unsafe extern "C-unwind" fn() -> *const c_char§Byond_GetVersion: unsafe extern "C-unwind" fn(version: *mut u4c, build: *mut u4c)§Byond_GetDMBVersion: unsafe extern "C-unwind" fn() -> u4c§ByondValue_Clear: unsafe extern "C-unwind" fn(v: *mut CByondValue)§ByondValue_Type: unsafe extern "C-unwind" fn(v: *const CByondValue) -> ByondValueType§ByondValue_IsNull: unsafe extern "C-unwind" fn(v: *const CByondValue) -> bool§ByondValue_IsNum: unsafe extern "C-unwind" fn(v: *const CByondValue) -> bool§ByondValue_IsStr: unsafe extern "C-unwind" fn(v: *const CByondValue) -> bool§ByondValue_IsList: unsafe extern "C-unwind" fn(v: *const CByondValue) -> bool§ByondValue_IsTrue: unsafe extern "C-unwind" fn(v: *const CByondValue) -> bool§ByondValue_GetNum: unsafe extern "C-unwind" fn(v: *const CByondValue) -> f32§ByondValue_GetRef: unsafe extern "C-unwind" fn(v: *const CByondValue) -> u4c§ByondValue_SetNum: unsafe extern "C-unwind" fn(v: *mut CByondValue, f: f32)§ByondValue_SetStr: unsafe extern "C-unwind" fn(v: *mut CByondValue, str_: *const c_char)§ByondValue_SetRef: unsafe extern "C-unwind" fn(v: *mut CByondValue, type_: ByondValueType, ref_: u4c)§ByondValue_Equals: unsafe extern "C-unwind" fn(a: *const CByondValue, b: *const CByondValue) -> bool§Byond_ThreadSync: unsafe extern "C-unwind" fn(callback: ByondCallback, data: *mut c_void, block: bool) -> CByondValue§Byond_GetStrId: unsafe extern "C-unwind" fn(str_: *const c_char) -> u4c§Byond_AddGetStrId: unsafe extern "C-unwind" fn(str_: *const c_char) -> u4c§Byond_ReadVar: unsafe extern "C-unwind" fn(loc: *const CByondValue, varname: *const c_char, result: *mut CByondValue) -> bool§Byond_ReadVarByStrId: unsafe extern "C-unwind" fn(loc: *const CByondValue, varname: u4c, result: *mut CByondValue) -> bool§Byond_WriteVar: unsafe extern "C-unwind" fn(loc: *const CByondValue, varname: *const c_char, val: *const CByondValue) -> bool§Byond_WriteVarByStrId: unsafe extern "C-unwind" fn(loc: *const CByondValue, varname: u4c, val: *const CByondValue) -> bool§Byond_CreateList: unsafe extern "C-unwind" fn(result: *mut CByondValue) -> bool§Byond_ReadList: unsafe extern "C-unwind" fn(loc: *const CByondValue, list: *mut CByondValue, len: *mut u4c) -> bool§Byond_WriteList: unsafe extern "C-unwind" fn(loc: *const CByondValue, list: *const CByondValue, len: u4c) -> bool§Byond_ReadListAssoc: unsafe extern "C-unwind" fn(loc: *const CByondValue, list: *mut CByondValue, len: *mut u4c) -> bool§Byond_ReadListIndex: unsafe extern "C-unwind" fn(loc: *const CByondValue, idx: *const CByondValue, result: *mut CByondValue) -> bool§Byond_WriteListIndex: unsafe extern "C-unwind" fn(loc: *const CByondValue, idx: *const CByondValue, val: *const CByondValue) -> bool§Byond_ReadPointer: unsafe extern "C-unwind" fn(ptr: *const CByondValue, result: *mut CByondValue) -> bool§Byond_WritePointer: unsafe extern "C-unwind" fn(ptr: *const CByondValue, val: *const CByondValue) -> bool§Byond_CallProc: unsafe extern "C-unwind" fn(src: *const CByondValue, name: *const c_char, arg: *const CByondValue, arg_count: u4c, result: *mut CByondValue) -> bool§Byond_CallProcByStrId: unsafe extern "C-unwind" fn(src: *const CByondValue, name: u4c, arg: *const CByondValue, arg_count: u4c, result: *mut CByondValue) -> bool§Byond_CallGlobalProc: unsafe extern "C-unwind" fn(name: *const c_char, arg: *const CByondValue, arg_count: u4c, result: *mut CByondValue) -> bool§Byond_CallGlobalProcByStrId: unsafe extern "C-unwind" fn(name: u4c, arg: *const CByondValue, arg_count: u4c, result: *mut CByondValue) -> bool§Byond_ToString: unsafe extern "C-unwind" fn(src: *const CByondValue, buf: *mut c_char, buflen: *mut u4c) -> bool§Byond_Block: unsafe extern "C-unwind" fn(corner1: *const CByondXYZ, corner2: *const CByondXYZ, list: *mut CByondValue, len: *mut u4c) -> bool§Byond_Length: unsafe extern "C-unwind" fn(src: *const CByondValue, result: *mut CByondValue) -> bool§Byond_LocateIn: unsafe extern "C-unwind" fn(type_: *const CByondValue, list: *const CByondValue, result: *mut CByondValue) -> bool§Byond_LocateXYZ: unsafe extern "C-unwind" fn(xyz: *const CByondXYZ, result: *mut CByondValue) -> bool§Byond_New: unsafe extern "C-unwind" fn(type_: *const CByondValue, arg: *const CByondValue, arg_count: u4c, result: *mut CByondValue) -> bool§Byond_NewArglist: unsafe extern "C-unwind" fn(type_: *const CByondValue, arglist: *const CByondValue, result: *mut CByondValue) -> bool§Byond_Refcount: unsafe extern "C-unwind" fn(src: *const CByondValue, result: *mut u4c) -> bool§Byond_XYZ: unsafe extern "C-unwind" fn(src: *const CByondValue, xyz: *mut CByondXYZ) -> bool§ByondValue_IncRef: unsafe extern "C-unwind" fn(src: *const CByondValue)§ByondValue_DecRef: unsafe extern "C-unwind" fn(src: *const CByondValue)§Byond_TestRef: unsafe extern "C-unwind" fn(src: *mut CByondValue) -> bool

Implementations§

source§

impl ByondApi

source

pub unsafe fn new<P>(path: P) -> Result<Self, Error>
where P: AsRef<OsStr>,

source

pub unsafe fn from_library<L>(library: L) -> Result<Self, Error>
where L: Into<Library>,

source

pub unsafe fn Byond_LastError(&self) -> *const c_char

Gets the last error from a failed call The result is a static string that does not need to be freed.

§Returns

Error message

source

pub unsafe fn Byond_GetVersion(&self, version: *mut u4c, build: *mut u4c)

Gets the current BYOND version

§Arguments
  • version - Pointer to the major version number
  • build - Pointer to the build number
source

pub unsafe fn Byond_GetDMBVersion(&self) -> u4c

Gets the DMB version

§Returns

Version number the .dmb was built with

source

pub unsafe fn ByondValue_Clear(&self, v: *mut CByondValue)

Fills a CByondValue struct with a null value.

§Arguments
  • v - Pointer to CByondValue
source

pub unsafe fn ByondValue_Type(&self, v: *const CByondValue) -> ByondValueType

Reads CByondVale’s 1-byte data type

§Arguments
  • v - Pointer to CByondValue
§Returns

Type of value

source

pub unsafe fn ByondValue_IsNull(&self, v: *const CByondValue) -> bool

§Arguments
  • v - Pointer to CByondValue
§Returns

True if value is null

source

pub unsafe fn ByondValue_IsNum(&self, v: *const CByondValue) -> bool

§Arguments
  • v - Pointer to CByondValue
§Returns

True if value is a numeric type

source

pub unsafe fn ByondValue_IsStr(&self, v: *const CByondValue) -> bool

§Arguments
  • v - Pointer to CByondValue
§Returns

True if value is a string

source

pub unsafe fn ByondValue_IsList(&self, v: *const CByondValue) -> bool

§Arguments
  • v - Pointer to CByondValue
§Returns

True if value is a list (any list type, not just user-defined)

source

pub unsafe fn ByondValue_IsTrue(&self, v: *const CByondValue) -> bool

Determines if a value is logically true or false

§Arguments
  • v - Pointer to CByondValue
§Returns

Truthiness of value

source

pub unsafe fn ByondValue_GetNum(&self, v: *const CByondValue) -> f32

§Arguments
  • v - Pointer to CByondValue
§Returns

Floating point number for v, or 0 if not numeric

source

pub unsafe fn ByondValue_GetRef(&self, v: *const CByondValue) -> u4c

§Arguments
  • v - Pointer to CByondValue
§Returns

Reference ID if value is a reference type, or 0 otherwise

source

pub unsafe fn ByondValue_SetNum(&self, v: *mut CByondValue, f: f32)

Fills a CByondValue struct with a floating point number.

§Arguments
  • v - Pointer to CByondValue
  • f - Floating point number
source

pub unsafe fn ByondValue_SetStr(&self, v: *mut CByondValue, str_: *const c_char)

Creates a string and sets CByondValue to a temporary reference to that string. Blocks if not on the main thread. If string creation fails, the struct is set to null.

§Arguments
  • v - Pointer to CByondValue
  • str - Null-terminated UTF-8 string [Byond_AddGetStrId()]
source

pub unsafe fn ByondValue_SetRef( &self, v: *mut CByondValue, type_: ByondValueType, ref_: u4c, )

Fills a CByondValue struct with a reference (object) type. Does not validate.

§Arguments
  • v - Pointer to CByondValue
  • type - 1-byte teference type
  • ref - 4-byte reference ID; for most types, an ID of NONE is invalid [Byond_TestRef()]
source

pub unsafe fn ByondValue_Equals( &self, a: *const CByondValue, b: *const CByondValue, ) -> bool

Compares two values for equality

§Arguments
  • a - Pointer to CByondValue
  • b - Pointer to CByondValue
§Returns

True if values are equal

source

pub unsafe fn Byond_ThreadSync( &self, callback: ByondCallback, data: *mut c_void, block: bool, ) -> CByondValue

Runs a function as a callback on the main thread (or right away if already there) Blocking is optional. If already on the main thread, the block parameter is meaningless.

§Arguments
  • callback - Function pointer to CByondValue function(void*)
  • data - Void pointer (argument to function)
  • block - True if this call should block while waiting for the callback to finish; false if not
§Returns

CByondValue returned by the function (if it blocked; null if not)

source

pub unsafe fn Byond_GetStrId(&self, str_: *const c_char) -> u4c

Returns a reference to an existing string ID, but does not create a new string ID. Blocks if not on the main thread.

§Arguments
  • str - Null-terminated string
§Returns

ID of string; NONE if string does not exist

source

pub unsafe fn Byond_AddGetStrId(&self, str_: *const c_char) -> u4c

Returns a reference to an existing string ID or creates a new string ID with a temporary reference. Blocks if not on the main thread.

§Arguments
  • str - Null-terminated string
§Returns

ID of string; NONE if string creation failed

source

pub unsafe fn Byond_ReadVar( &self, loc: *const CByondValue, varname: *const c_char, result: *mut CByondValue, ) -> bool

Reads an object variable by name. Blocks if not on the main thread.

§Arguments
  • loc - Object that owns the var
  • varname - Var name as null-terminated string
  • result - Pointer to accept result
§Returns

True on success

source

pub unsafe fn Byond_ReadVarByStrId( &self, loc: *const CByondValue, varname: u4c, result: *mut CByondValue, ) -> bool

Reads an object variable by the string ID of its var name. ID can be cached ahead of time for performance. Blocks if not on the main thread.

§Arguments
  • loc - Object that owns the var
  • varname - Var name as string ID
  • result - Pointer to accept result
§Returns

True on success [Byond_GetStrId()]

source

pub unsafe fn Byond_WriteVar( &self, loc: *const CByondValue, varname: *const c_char, val: *const CByondValue, ) -> bool

Writes an object variable by name. Blocks if not on the main thread.

§Arguments
  • loc - Object that owns the var
  • varname - Var name as null-terminated string
  • val - New value
§Returns

True on success

source

pub unsafe fn Byond_WriteVarByStrId( &self, loc: *const CByondValue, varname: u4c, val: *const CByondValue, ) -> bool

Writes an object variable by the string ID of its var name. ID can be cached ahead of time for performance. Blocks if not on the main thread.

§Arguments
  • loc - Object that owns the var
  • varname - Var name as string ID
  • val - New value
§Returns

True on success

source

pub unsafe fn Byond_CreateList(&self, result: *mut CByondValue) -> bool

Creates an empty list with a temporary reference. Equivalent to list(). Blocks if not on the main thread.

§Arguments
  • result - Result
§Returns

True on success

source

pub unsafe fn Byond_ReadList( &self, loc: *const CByondValue, list: *mut CByondValue, len: *mut u4c, ) -> bool

Reads items from a list. Blocks if not on the main thread.

§Arguments
  • loc - The list to read
  • list - CByondValue array, allocated by caller (can be null if querying length)
  • len - Pointer to length of array (in items); receives the number of items read on success, or required length of array if not big enough
§Returns

True on success; false with *len=0 for failure; false with *len=required size if array is not big enough

source

pub unsafe fn Byond_WriteList( &self, loc: *const CByondValue, list: *const CByondValue, len: u4c, ) -> bool

Writes items to a list, in place of old contents. Blocks if not on the main thread.

§Arguments
  • loc - The list to fill
  • list - CByondValue array of items to write
  • len - Number of items to write
§Returns

True on success

source

pub unsafe fn Byond_ReadListAssoc( &self, loc: *const CByondValue, list: *mut CByondValue, len: *mut u4c, ) -> bool

Reads items as key,value pairs from an associative list, storing them sequentially as key1, value1, key2, value2, etc. Blocks if not on the main thread.

§Arguments
  • loc - The list to read
  • list - CByondValue array, allocated by caller (can be null if querying length)
  • len - Pointer to length of array (in items); receives the number of items read on success, or required length of array if not big enough
§Returns

True on success; false with *len=0 for failure; false with *len=required size if array is not big enough

source

pub unsafe fn Byond_ReadListIndex( &self, loc: *const CByondValue, idx: *const CByondValue, result: *mut CByondValue, ) -> bool

Reads an item from a list. Blocks if not on the main thread.

§Arguments
  • loc - The list
  • idx - The index in the list (may be a number, or a non-number if using associative lists)
  • result - Pointer to accept result
§Returns

True on success

source

pub unsafe fn Byond_WriteListIndex( &self, loc: *const CByondValue, idx: *const CByondValue, val: *const CByondValue, ) -> bool

Writes an item to a list. Blocks if not on the main thread.

§Arguments
  • loc - The list
  • idx - The index in the list (may be a number, or a non-number if using associative lists)
  • val - New value
§Returns

True on success

source

pub unsafe fn Byond_ReadPointer( &self, ptr: *const CByondValue, result: *mut CByondValue, ) -> bool

Reads from a BYOND pointer Blocks if not on the main thread.

§Arguments
  • ptr - The BYOND pointer
  • result - Pointer to accept result
§Returns

True on success

source

pub unsafe fn Byond_WritePointer( &self, ptr: *const CByondValue, val: *const CByondValue, ) -> bool

Writes to a BYOND pointer Blocks if not on the main thread.

§Arguments
  • ptr - The BYOND pointer
  • val - New value
§Returns

True on success

source

pub unsafe fn Byond_CallProc( &self, src: *const CByondValue, name: *const c_char, arg: *const CByondValue, arg_count: u4c, result: *mut CByondValue, ) -> bool

Calls an object proc by name. The proc call is treated as waitfor=0 and will return immediately on sleep. Blocks if not on the main thread.

§Arguments
  • src - The object that owns the proc
  • name - Proc name as null-terminated string
  • arg - Array of arguments
  • arg_count - Number of arguments
  • result - Pointer to accept result
§Returns

True on success

source

pub unsafe fn Byond_CallProcByStrId( &self, src: *const CByondValue, name: u4c, arg: *const CByondValue, arg_count: u4c, result: *mut CByondValue, ) -> bool

Calls an object proc by name, where the name is a string ID. The proc call is treated as waitfor=0 and will return immediately on sleep. Blocks if not on the main thread.

§Arguments
  • src - The object that owns the proc
  • name - Proc name as string ID
  • arg - Array of arguments
  • arg_count - Number of arguments
  • result - Pointer to accept result
§Returns

True on success [Byond_GetStrId()]

source

pub unsafe fn Byond_CallGlobalProc( &self, name: *const c_char, arg: *const CByondValue, arg_count: u4c, result: *mut CByondValue, ) -> bool

Calls a global proc by name. The proc call is treated as waitfor=0 and will return immediately on sleep. Blocks if not on the main thread.

§Arguments
  • name - Proc name as null-terminated string
  • arg - Array of arguments
  • arg_count - Number of arguments
  • result - Pointer to accept result
§Returns

True on success

source

pub unsafe fn Byond_CallGlobalProcByStrId( &self, name: u4c, arg: *const CByondValue, arg_count: u4c, result: *mut CByondValue, ) -> bool

Calls a global proc by name, where the name is a string ID. The proc call is treated as waitfor=0 and will return immediately on sleep. Blocks if not on the main thread.

§Arguments
  • name - Proc name as string ID
  • arg - Array of arguments
  • arg_count - Number of arguments
  • result - Pointer to accept result
§Returns

True on success [Byond_GetStrId()]

source

pub unsafe fn Byond_ToString( &self, src: *const CByondValue, buf: *mut c_char, buflen: *mut u4c, ) -> bool

Uses BYOND’s internals to represent a value as text Blocks if not on the main thread.

§Arguments
  • src - The value to convert to text
  • buf - char array, allocated by caller (can be null if querying length)
  • buflen - Pointer to length of array in bytes; receives the string length (including trailing null) on success, or required length of array if not big enough
§Returns

True on success; false with *buflen=0 for failure; false with *buflen=required size if array is not big enough

source

pub unsafe fn Byond_Block( &self, corner1: *const CByondXYZ, corner2: *const CByondXYZ, list: *mut CByondValue, len: *mut u4c, ) -> bool

Equivalent to calling block(x1,y1,z1, x2,y2,z2). Blocks if not on the main thread.

§Arguments
  • corner1 - One corner of the block
  • corner2 - Another corner of the block
  • list - CByondValue array, allocated by caller (can be null if querying length)
  • len - Pointer to length of array (in items); receives the number of items read on success, or required length of array if not big enough
§Returns

True on success; false with *len=0 for failure; false with *len=required size if array is not big enough

source

pub unsafe fn Byond_Length( &self, src: *const CByondValue, result: *mut CByondValue, ) -> bool

Equivalent to calling length(value). Blocks if not on the main thread.

§Arguments
  • src - The value
  • result - Pointer to accept result as a CByondValue (intended for future possible override of length)
§Returns

True on success

source

pub unsafe fn Byond_LocateIn( &self, type_: *const CByondValue, list: *const CByondValue, result: *mut CByondValue, ) -> bool

Equivalent to calling locate(type), or locate(type) in list. Blocks if not on the main thread.

§Arguments
  • type - The type to locate
  • list - The list to locate in; can be a null pointer instead of a CByondValue to locate(type) without a list
  • result - Pointer to accept result; can be null if nothing is found
§Returns

True on success (including if nothing is found); false on error

source

pub unsafe fn Byond_LocateXYZ( &self, xyz: *const CByondXYZ, result: *mut CByondValue, ) -> bool

Equivalent to calling locate(x,y,z) Blocks if not on the main thread. Result is null if coords are invalid.

§Arguments
  • xyz - The x,y,z coords
  • result - Pointer to accept result
§Returns

True (always)

source

pub unsafe fn Byond_New( &self, type_: *const CByondValue, arg: *const CByondValue, arg_count: u4c, result: *mut CByondValue, ) -> bool

Equivalent to calling new type(…) Blocks if not on the main thread.

§Arguments
  • type - The type to create (type path or string)
  • arg - Array of arguments
  • arg_count - Number of arguments
  • result - Pointer to accept result
§Returns

True on success

source

pub unsafe fn Byond_NewArglist( &self, type_: *const CByondValue, arglist: *const CByondValue, result: *mut CByondValue, ) -> bool

Equivalent to calling new type(arglist) Blocks if not on the main thread.

§Arguments
  • type - The type to create (type path or string)
  • arglist - Arguments, as a reference to an arglist
  • result - Pointer to accept result
§Returns

True on success

source

pub unsafe fn Byond_Refcount( &self, src: *const CByondValue, result: *mut u4c, ) -> bool

Equivalent to calling refcount(value) Blocks if not on the main thread.

§Arguments
  • src - The object to refcount
  • result - Pointer to accept result
§Returns

True on success

source

pub unsafe fn Byond_XYZ( &self, src: *const CByondValue, xyz: *mut CByondXYZ, ) -> bool

Get x,y,z coords of an atom Blocks if not on the main thread.

§Arguments
  • src - The object to read
  • xyz - Pointer to accept CByondXYZ result
§Returns

True on success

source

pub unsafe fn ByondValue_IncRef(&self, src: *const CByondValue)

Mark a reference as in use by Byondapi This should be done for any temporary references returned from other calls, if they need to be saved awhile. Blocks if not on the main thread.

§Arguments
  • src - The object to incref
source

pub unsafe fn ByondValue_DecRef(&self, src: *const CByondValue)

Mark a reference as no longer in use by Byondapi This can be used for temporary references to let them go immediately. Blocks if not on the main thread.

§Arguments
  • src - The object to decref
source

pub unsafe fn Byond_TestRef(&self, src: *mut CByondValue) -> bool

Test if a reference-type CByondValue is valid Blocks if not on the main thread.

§Arguments
  • src - Pointer to the reference to test; will be filled with null if the reference is invalid
§Returns

True if ref is valid; false if not

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.