[−][src]Trait flutter_engine::channel::Channel
Associated Types
type R
type Codec: MethodCodec<R = Self::R>
Required methods
fn get_name(&self) -> &str
fn init(&self, registry: *const PluginRegistry)
fn get_engine(&self) -> Option<Weak<FlutterEngineInner>>
Provided methods
fn invoke_method(&self, method_call: MethodCall<Self::R>)
Invoke a flutter method using this channel
fn decode_method_call(&self, msg: &PlatformMessage) -> MethodCall<Self::R>
Decode dart method call
fn send_success_event(&self, data: &Self::R)
When flutter listen to a stream of events using EventChannel. This method send back a success event. It can be call multiple times to simulate stream.
fn send_error_event(&self, code: &str, message: &str, data: &Self::R)
When flutter listen to a stream of events using EventChannel. This method send back a error event. It can be call multiple times to simulate stream.
fn send_method_call_response(
&self,
response_handle: Option<&FlutterPlatformMessageResponseHandle>,
ret: MethodCallResult<Self::R>
) -> bool
&self,
response_handle: Option<&FlutterPlatformMessageResponseHandle>,
ret: MethodCallResult<Self::R>
) -> bool
Send a method call response
fn send_response(
&self,
response_handle: &FlutterPlatformMessageResponseHandle,
buf: &[u8]
)
&self,
response_handle: &FlutterPlatformMessageResponseHandle,
buf: &[u8]
)
When flutter call a method using MethodChannel, it can wait for rust response using await syntax. This method send a response to flutter. This is a low level method. Please use send_method_call_response if that will work.
fn send_platform_message(&self, msg: &PlatformMessage)
Send a platform message over this channel. This is a low level method.
Implementors
impl Channel for JsonMethodChannel
[src]
type Codec = JsonMethodCodec
type R = Value
fn get_name(&self) -> &str
[src]
fn init(&self, registry: *const PluginRegistry)
[src]
fn get_engine(&self) -> Option<Weak<FlutterEngineInner>>
[src]
fn invoke_method(&self, method_call: MethodCall<Self::R>)
[src]
fn decode_method_call(&self, msg: &PlatformMessage) -> MethodCall<Self::R>
[src]
fn send_success_event(&self, data: &Self::R)
[src]
fn send_error_event(&self, code: &str, message: &str, data: &Self::R)
[src]
fn send_method_call_response(
&self,
response_handle: Option<&FlutterPlatformMessageResponseHandle>,
ret: MethodCallResult<Self::R>
) -> bool
[src]
&self,
response_handle: Option<&FlutterPlatformMessageResponseHandle>,
ret: MethodCallResult<Self::R>
) -> bool
fn send_response(
&self,
response_handle: &FlutterPlatformMessageResponseHandle,
buf: &[u8]
)
[src]
&self,
response_handle: &FlutterPlatformMessageResponseHandle,
buf: &[u8]
)
fn send_platform_message(&self, msg: &PlatformMessage)
[src]
impl Channel for StandardMethodChannel
[src]
type Codec = StandardMethodCodec
type R = Value
fn get_name(&self) -> &str
[src]
fn init(&self, registry: *const PluginRegistry)
[src]
fn get_engine(&self) -> Option<Weak<FlutterEngineInner>>
[src]
fn invoke_method(&self, method_call: MethodCall<Self::R>)
[src]
fn decode_method_call(&self, msg: &PlatformMessage) -> MethodCall<Self::R>
[src]
fn send_success_event(&self, data: &Self::R)
[src]
fn send_error_event(&self, code: &str, message: &str, data: &Self::R)
[src]
fn send_method_call_response(
&self,
response_handle: Option<&FlutterPlatformMessageResponseHandle>,
ret: MethodCallResult<Self::R>
) -> bool
[src]
&self,
response_handle: Option<&FlutterPlatformMessageResponseHandle>,
ret: MethodCallResult<Self::R>
) -> bool
fn send_response(
&self,
response_handle: &FlutterPlatformMessageResponseHandle,
buf: &[u8]
)
[src]
&self,
response_handle: &FlutterPlatformMessageResponseHandle,
buf: &[u8]
)