ScriptModuleCallHandle

Struct ScriptModuleCallHandle 

Source
pub struct ScriptModuleCallHandle { /* private fields */ }
Available on crate feature module only.
Expand description

関数の引数・返り値を扱うための型とトレイト。

Implementations§

Source§

impl ScriptModuleCallHandle

Source

pub unsafe fn from_ptr(ptr: *mut SCRIPT_MODULE_PARAM) -> ScriptModuleCallHandle

ポインタからScriptModuleParamを作成する。

§Safety

ptrは有効なSCRIPT_MODULE_PARAMへのポインタである必要があります。

Source

pub fn len(&self) -> usize

引数の数を返す。

Source

pub fn is_empty(&self) -> bool

引数が与えられていないかを返す。

Source

pub fn get_param<'a, T: FromScriptModuleParam<'a>>( &'a self, index: usize, ) -> Option<T>

引数を取得する。

Source

pub fn get_param_int(&self, index: usize) -> i32

引数を整数として取得する。

§Note

引数を取得できない場合は0を返します。

Source

pub fn get_param_float(&self, index: usize) -> f64

引数を浮動小数点数として取得する。

§Note

引数を取得できない場合は0.0を返します。

Source

pub fn get_param_str(&self, index: usize) -> Option<String>

引数を文字列として取得する。

Source

pub fn get_param_data<T>(&self, index: usize) -> Option<*mut T>

引数をデータポインタとして取得する。

§Note

引数を取得できない場合はNoneを返します。

Source

pub fn get_param_boolean(&self, index: usize) -> bool

引数をブール値として取得する。

§Note

引数を取得できない場合はfalseを返します。

Source

pub fn get_param_table_int( &self, index: usize, key: &str, ) -> ScriptModuleCallHandleResult<i32>

引数のテーブルの要素を整数として取得する。

§Note

引数を取得できない場合は0を返します。

Source

pub fn get_param_table_float( &self, index: usize, key: &str, ) -> ScriptModuleCallHandleResult<f64>

引数のテーブルの要素を浮動小数点数として取得する。

§Note

引数を取得できない場合は0.0を返します。

Source

pub fn get_param_table_str( &self, index: usize, key: &str, ) -> ScriptModuleCallHandleResult<Option<String>>

引数のテーブルの要素を文字列として取得する。

Source

pub fn get_param_array_len(&self, index: usize) -> usize

引数の配列の要素の数を取得する。

Source

pub fn get_param_array_int(&self, index: usize, array_index: usize) -> i32

引数の配列の要素を数値として取得する。

Source

pub fn get_param_array_float(&self, index: usize, array_index: usize) -> f64

引数の配列の要素を浮動小数点数として取得する。

Source

pub fn get_param_array_str( &self, index: usize, array_index: usize, ) -> Option<String>

引数の配列の要素を文字列として取得する。

Source

pub fn set_error(&mut self, message: &str) -> ScriptModuleCallHandleResult<()>

関数のエラーを設定する。

Source

pub fn push_result<T: IntoScriptModuleReturnValue>( &mut self, value: T, ) -> Result<(), IntoScriptModuleReturnValueError<T::Err>>

関数の返り値を追加する。

Source

pub fn push_result_int(&mut self, value: i32)

関数の返り値に整数を追加する。

Source

pub fn push_result_float(&mut self, value: f64)

関数の返り値に浮動小数点数を追加する。

Source

pub fn push_result_str( &mut self, value: &str, ) -> ScriptModuleCallHandleResult<()>

関数の返り値に文字列を追加する。

Source

pub fn push_result_table_int<'a, T>( &mut self, table: T, ) -> ScriptModuleCallHandleResult<()>
where T: IntoIterator<Item = (&'a str, i32)>,

関数の返り値に整数の連想配列を追加する。

Source

pub fn push_result_table_float<'a, T>( &mut self, table: T, ) -> ScriptModuleCallHandleResult<()>
where T: IntoIterator<Item = (&'a str, f64)>,

関数の返り値に浮動小数点数の連想配列を追加する。

Source

pub fn push_result_table_str<'a, T>( &mut self, table: T, ) -> ScriptModuleCallHandleResult<()>
where T: IntoIterator<Item = (&'a str, &'a str)>,

関数の返り値に文字列の連想配列を追加する。

Source

pub fn push_result_array_int( &mut self, values: &[i32], ) -> ScriptModuleCallHandleResult<()>

関数の返り値に整数の配列を追加する。

Source

pub fn push_result_array_float( &mut self, values: &[f64], ) -> ScriptModuleCallHandleResult<()>

関数の返り値に浮動小数点数の配列を追加する。

Source

pub fn push_result_array_str( &mut self, values: &[&str], ) -> ScriptModuleCallHandleResult<()>

関数の返り値に文字列の配列を追加する。

Source

pub fn push_result_boolean(&mut self, value: bool)

関数の返り値にブール値を追加する。

Trait Implementations§

Source§

impl Debug for ScriptModuleCallHandle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<*mut SCRIPT_MODULE_PARAM> for ScriptModuleCallHandle

Source§

fn from(ptr: *mut SCRIPT_MODULE_PARAM) -> Self

Converts to this type from the input type.

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.