[−][src]Function xaynet::sdk::api::update_model
#[no_mangle]pub unsafe extern "C" fn update_model(client: *mut FFIClient) -> c_int
Registers the cached model as an updated local model.
This clears the cached model.
Errors
Ignores null pointer client
s and returns immediately.
Returns an error if there is no cached model to register.
The error codes are as following:
-1
: client didn't update due to null pointer0
: no error1
: client didn't update due missing cached model
Safety
The method dereferences from the raw pointer arguments. Therefore, the behavior of the method is undefined if the arguments don't point to valid objects.
The memory of the cached model is is either allocated by new_model()
or get_model()
.
Therefore, the behavior of the method is undefined if the memory was modified in an invalid way.