INNER CODE UNIT · Rust
encode_error_envelope
nativeshell/nativeshell · nativeshell/src/codec/mod.rs:76
fn encode_error_envelope(&self, code: &str, message: Option<&str>, details: &V) -> Vec<u8>;
fn encode_method_call_result(&self, response: &MethodCallResult<V>) -> Vec<u8> {
match response {
MethodCallResult::Ok(data) => self.encode_success_envelope(data),
MethodCallResult::Err(err) => {
self.encode_error_envelope(&err.code, err.message.as_deref(), &err.details)
}
}
}
/// Methods for calling into dart
fn encode_method_call(&self, v: &MethodCall<V>) -> Vec<u8>;
fn decode_envelope(&self, buf: &[u8]) -> Option<MethodCallResult<V>>;
}