pub struct DynamicCall { /* private fields */ }Expand description
Builder for a reflection-based function call.
Typical usage:
ⓘ
let mut call = DynamicCall::new(&obj, "DoSomething")?;
call.set::<i32>("Param1", 42)?;
let result = call.call()?;
let ret: f32 = result.get::<f32>("ReturnValue")?;Implementations§
Source§impl DynamicCall
impl DynamicCall
Sourcepub fn new(obj: &UObjectRef<impl UeClass>, func_name: &str) -> UikaResult<Self>
pub fn new(obj: &UObjectRef<impl UeClass>, func_name: &str) -> UikaResult<Self>
Prepare a reflection call to the named function on obj.
Sourcepub fn set<T: Copy>(&mut self, name: &str, value: T) -> UikaResult<()>
pub fn set<T: Copy>(&mut self, name: &str, value: T) -> UikaResult<()>
Write a parameter value into the params buffer.
§Safety contract
T must match the actual UE property type at the named parameter.
Using the wrong type leads to undefined behavior at runtime. This is
inherently less safe than the codegen direct-call path.
Sourcepub fn call(self) -> UikaResult<DynamicCallResult>
pub fn call(self) -> UikaResult<DynamicCallResult>
Invoke the function via ProcessEvent. Consumes this builder and returns
a DynamicCallResult for reading output/return values.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DynamicCall
impl RefUnwindSafe for DynamicCall
impl !Send for DynamicCall
impl !Sync for DynamicCall
impl Unpin for DynamicCall
impl UnsafeUnpin for DynamicCall
impl UnwindSafe for DynamicCall
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