dispatch.rs 344 B

1234567891011121314
  1. use std::convert::TryInto;
  2. use bytes::Bytes;
  3. use lib_dispatch::prelude::{AFPluginEventResponse, ResponseBuilder};
  4. use crate::FlowyError;
  5. impl lib_dispatch::Error for FlowyError {
  6. fn as_response(&self) -> AFPluginEventResponse {
  7. let bytes: Bytes = self.clone().try_into().unwrap();
  8. ResponseBuilder::Err().data(bytes).build()
  9. }
  10. }