mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: update documentation
This commit is contained in:
@ -46,7 +46,7 @@ pub extern "C" fn async_event(port: i64, input: *const u8, len: usize) {
|
||||
}
|
||||
Some(e) => e.event_dispatcher.clone(),
|
||||
};
|
||||
let _ = AFPluginDispatcher::async_send_with_callback(dispatcher, request, move |resp: EventResponse| {
|
||||
let _ = AFPluginDispatcher::async_send_with_callback(dispatcher, request, move |resp: AFPluginEventResponse| {
|
||||
log::trace!("[FFI]: Post data to dart through {} port", port);
|
||||
Box::pin(post_to_flutter(resp, port))
|
||||
});
|
||||
@ -83,7 +83,7 @@ pub extern "C" fn set_stream_port(port: i64) -> i32 {
|
||||
pub extern "C" fn link_me_please() {}
|
||||
|
||||
#[inline(always)]
|
||||
async fn post_to_flutter(response: EventResponse, port: i64) {
|
||||
async fn post_to_flutter(response: AFPluginEventResponse, port: i64) {
|
||||
let isolate = allo_isolate::Isolate::new(port);
|
||||
match isolate
|
||||
.catch_unwind(async {
|
||||
|
@ -1,5 +1,5 @@
|
||||
use flowy_derive::{ProtoBuf, ProtoBuf_Enum};
|
||||
use lib_dispatch::prelude::{EventResponse, Payload, StatusCode};
|
||||
use lib_dispatch::prelude::{AFPluginEventResponse, Payload, StatusCode};
|
||||
|
||||
#[derive(ProtoBuf_Enum, Clone, Copy)]
|
||||
pub enum FFIStatusCode {
|
||||
@ -23,8 +23,8 @@ pub struct FFIResponse {
|
||||
code: FFIStatusCode,
|
||||
}
|
||||
|
||||
impl std::convert::From<EventResponse> for FFIResponse {
|
||||
fn from(resp: EventResponse) -> Self {
|
||||
impl std::convert::From<AFPluginEventResponse> for FFIResponse {
|
||||
fn from(resp: AFPluginEventResponse) -> Self {
|
||||
let payload = match resp.payload {
|
||||
Payload::Bytes(bytes) => bytes.to_vec(),
|
||||
Payload::None => vec![],
|
||||
|
Reference in New Issue
Block a user