pub struct ScriptModuleCallHandle { /* private fields */ }Available on crate feature
module only.Expand description
関数の引数・返り値を扱うための型とトレイト。
Implementations§
Source§impl ScriptModuleCallHandle
impl ScriptModuleCallHandle
Sourcepub unsafe fn from_raw(ptr: *mut SCRIPT_MODULE_PARAM) -> ScriptModuleCallHandle
pub unsafe fn from_raw(ptr: *mut SCRIPT_MODULE_PARAM) -> ScriptModuleCallHandle
Sourcepub fn get_param_type(&self, index: usize) -> Option<ParamType>
pub fn get_param_type(&self, index: usize) -> Option<ParamType>
Sourcepub fn get_param<'a, T: FromScriptModuleParam<'a>>(
&'a self,
index: usize,
) -> GetParamResult<T, T::Error>
pub fn get_param<'a, T: FromScriptModuleParam<'a>>( &'a self, index: usize, ) -> GetParamResult<T, T::Error>
引数を取得する。
Sourcepub fn get_param_int(&self, index: usize) -> GetParamResult<i32>
pub fn get_param_int(&self, index: usize) -> GetParamResult<i32>
引数を整数として取得する。
Sourcepub fn get_param_float(&self, index: usize) -> GetParamResult<f64>
pub fn get_param_float(&self, index: usize) -> GetParamResult<f64>
引数を浮動小数点数として取得する。
Sourcepub fn get_param_str(&self, index: usize) -> GetParamResult<String>
pub fn get_param_str(&self, index: usize) -> GetParamResult<String>
引数を文字列として取得する。
Sourcepub fn get_param_data<T>(&self, index: usize) -> GetParamResult<*mut T>
pub fn get_param_data<T>(&self, index: usize) -> GetParamResult<*mut T>
引数をデータポインタとして取得する。
Sourcepub fn get_param_userdata<T: AsScriptModuleUserData>(
&self,
index: usize,
) -> GetParamResult<ScriptModuleUserData<T>, ParamConversionError>
pub fn get_param_userdata<T: AsScriptModuleUserData>( &self, index: usize, ) -> GetParamResult<ScriptModuleUserData<T>, ParamConversionError>
引数をメタテーブルを持つ型付きuserdataとして取得する。
§Note
Tではない型から作成されたuserdataを取得しようとした場合は
GetParamError::ConversionErrorを返します。
Sourcepub fn get_param_boolean(&self, index: usize) -> GetParamResult<bool>
pub fn get_param_boolean(&self, index: usize) -> GetParamResult<bool>
引数をブール値として取得する。
Sourcepub fn get_param_table_int(
&self,
index: usize,
key: &str,
) -> ScriptModuleCallHandleResult<i32>
pub fn get_param_table_int( &self, index: usize, key: &str, ) -> ScriptModuleCallHandleResult<i32>
Sourcepub fn get_param_table_integer<T>(
&self,
index: usize,
key: &str,
) -> ScriptModuleCallHandleResult<T, T::Error>where
T: FromScriptModuleInteger,
pub fn get_param_table_integer<T>(
&self,
index: usize,
key: &str,
) -> ScriptModuleCallHandleResult<T, T::Error>where
T: FromScriptModuleInteger,
引数のテーブルの要素を整数として取得し、指定された型に変換する。
Sourcepub fn get_param_table_float(
&self,
index: usize,
key: &str,
) -> ScriptModuleCallHandleResult<f64>
pub fn get_param_table_float( &self, index: usize, key: &str, ) -> ScriptModuleCallHandleResult<f64>
Sourcepub fn get_param_table_str(
&self,
index: usize,
key: &str,
) -> ScriptModuleCallHandleResult<Option<String>>
pub fn get_param_table_str( &self, index: usize, key: &str, ) -> ScriptModuleCallHandleResult<Option<String>>
引数のテーブルの要素を文字列として取得する。
Sourcepub fn get_param_table_boolean(
&self,
index: usize,
key: &str,
) -> ScriptModuleCallHandleResult<bool>
pub fn get_param_table_boolean( &self, index: usize, key: &str, ) -> ScriptModuleCallHandleResult<bool>
Sourcepub fn get_param_array_len(&self, index: usize) -> usize
pub fn get_param_array_len(&self, index: usize) -> usize
引数の配列の要素の数を取得する。
Sourcepub fn get_param_array_int(&self, index: usize, array_index: usize) -> i32
pub fn get_param_array_int(&self, index: usize, array_index: usize) -> i32
引数の配列の要素を数値として取得する。
Sourcepub fn get_param_array_float(&self, index: usize, array_index: usize) -> f64
pub fn get_param_array_float(&self, index: usize, array_index: usize) -> f64
引数の配列の要素を浮動小数点数として取得する。
Sourcepub fn get_param_array_str(
&self,
index: usize,
array_index: usize,
) -> Option<String>
pub fn get_param_array_str( &self, index: usize, array_index: usize, ) -> Option<String>
引数の配列の要素を文字列として取得する。
Sourcepub fn set_error(&mut self, message: &str) -> ScriptModuleCallHandleResult<()>
pub fn set_error(&mut self, message: &str) -> ScriptModuleCallHandleResult<()>
関数のエラーを設定する。
Sourcepub fn push_result<T: IntoScriptModuleReturnValue>(
&mut self,
value: T,
) -> Result<(), IntoScriptModuleReturnValueError<T::Err>>
pub fn push_result<T: IntoScriptModuleReturnValue>( &mut self, value: T, ) -> Result<(), IntoScriptModuleReturnValueError<T::Err>>
関数の返り値を追加する。
Sourcepub fn push_result_int(&mut self, value: i32)
pub fn push_result_int(&mut self, value: i32)
関数の返り値に整数を追加する。
Sourcepub fn push_result_float(&mut self, value: f64)
pub fn push_result_float(&mut self, value: f64)
関数の返り値に浮動小数点数を追加する。
Sourcepub fn push_result_str(
&mut self,
value: &str,
) -> ScriptModuleCallHandleResult<()>
pub fn push_result_str( &mut self, value: &str, ) -> ScriptModuleCallHandleResult<()>
関数の返り値に文字列を追加する。
Sourcepub fn push_result_data<T>(&mut self, value: *const T)
pub fn push_result_data<T>(&mut self, value: *const T)
関数の返り値にデータポインタを追加する。
Sourcepub fn push_result_function(&mut self, callback: ScriptModuleFunctionCallback)
pub fn push_result_function(&mut self, callback: ScriptModuleFunctionCallback)
Sourcepub fn push_result_meta_table<T: Into<ErasedScriptModuleUserData>>(
&mut self,
meta_table: T,
)
pub fn push_result_meta_table<T: Into<ErasedScriptModuleUserData>>( &mut self, meta_table: T, )
関数の返り値にメタテーブルを追加する。
Sourcepub fn push_result_table_int<'a, T>(
&mut self,
table: T,
) -> ScriptModuleCallHandleResult<()>
pub fn push_result_table_int<'a, T>( &mut self, table: T, ) -> ScriptModuleCallHandleResult<()>
関数の返り値に整数の連想配列を追加する。
Sourcepub fn push_result_table_float<'a, T>(
&mut self,
table: T,
) -> ScriptModuleCallHandleResult<()>
pub fn push_result_table_float<'a, T>( &mut self, table: T, ) -> ScriptModuleCallHandleResult<()>
関数の返り値に浮動小数点数の連想配列を追加する。
Sourcepub fn push_result_table_str<'a, T>(
&mut self,
table: T,
) -> ScriptModuleCallHandleResult<()>
pub fn push_result_table_str<'a, T>( &mut self, table: T, ) -> ScriptModuleCallHandleResult<()>
関数の返り値に文字列の連想配列を追加する。
Sourcepub fn push_result_table_boolean<'a, T>(
&mut self,
table: T,
) -> ScriptModuleCallHandleResult<()>
pub fn push_result_table_boolean<'a, T>( &mut self, table: T, ) -> ScriptModuleCallHandleResult<()>
関数の返り値にブール値の連想配列を追加する。
Sourcepub fn push_result_array_int(
&mut self,
values: &[i32],
) -> ScriptModuleCallHandleResult<()>
pub fn push_result_array_int( &mut self, values: &[i32], ) -> ScriptModuleCallHandleResult<()>
関数の返り値に整数の配列を追加する。
Sourcepub fn push_result_array_float(
&mut self,
values: &[f64],
) -> ScriptModuleCallHandleResult<()>
pub fn push_result_array_float( &mut self, values: &[f64], ) -> ScriptModuleCallHandleResult<()>
関数の返り値に浮動小数点数の配列を追加する。
Sourcepub fn push_result_array_str(
&mut self,
values: &[&str],
) -> ScriptModuleCallHandleResult<()>
pub fn push_result_array_str( &mut self, values: &[&str], ) -> ScriptModuleCallHandleResult<()>
関数の返り値に文字列の配列を追加する。
Sourcepub fn push_result_array_boolean(
&mut self,
values: &[bool],
) -> ScriptModuleCallHandleResult<()>
pub fn push_result_array_boolean( &mut self, values: &[bool], ) -> ScriptModuleCallHandleResult<()>
関数の返り値にブール値の配列を追加する。
Sourcepub fn push_result_boolean(&mut self, value: bool)
pub fn push_result_boolean(&mut self, value: bool)
関数の返り値にブール値を追加する。
Sourcepub fn read_section(&self) -> &ReadSection
pub fn read_section(&self) -> &ReadSection
読み取り専用の編集セクション。
Trait Implementations§
Auto Trait Implementations§
impl !Send for ScriptModuleCallHandle
impl !Sync for ScriptModuleCallHandle
impl Freeze for ScriptModuleCallHandle
impl RefUnwindSafe for ScriptModuleCallHandle
impl Unpin for ScriptModuleCallHandle
impl UnsafeUnpin for ScriptModuleCallHandle
impl UnwindSafe for ScriptModuleCallHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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