pub struct ExternalMessagingAdapter { /* private fields */ }Expand description
Messaging adapter that delegates all operations to an external plugin process.
Each method call spawns a fresh process, sends one JSON request line to stdin, reads one JSON response line from stdout, then waits for exit.
Implementations§
Source§impl ExternalMessagingAdapter
impl ExternalMessagingAdapter
Sourcepub fn new(manifest: &MessagingPluginManifest) -> Self
pub fn new(manifest: &MessagingPluginManifest) -> Self
Create a new adapter from a discovered plugin manifest.
Sourcepub fn fetch(
&self,
since_iso8601: &str,
account: Option<&str>,
limit: Option<u32>,
) -> Result<Vec<FetchedMessage>, MessagingPluginError>
pub fn fetch( &self, since_iso8601: &str, account: Option<&str>, limit: Option<u32>, ) -> Result<Vec<FetchedMessage>, MessagingPluginError>
Fetch messages received since since_iso8601.
account is the email address to fetch from (None = plugin default).
Sourcepub fn create_draft(
&self,
draft: DraftEnvelope,
) -> Result<String, MessagingPluginError>
pub fn create_draft( &self, draft: DraftEnvelope, ) -> Result<String, MessagingPluginError>
Create a draft in the provider’s native Drafts folder.
Returns the provider-assigned draft ID (e.g., “gmail-draft-abc123”).
NOTE: There is intentionally no send method on this type.
TA never sends messages on behalf of the user.
Sourcepub fn draft_status(
&self,
draft_id: &str,
) -> Result<DraftState, MessagingPluginError>
pub fn draft_status( &self, draft_id: &str, ) -> Result<DraftState, MessagingPluginError>
Poll the current state of a previously created draft.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExternalMessagingAdapter
impl RefUnwindSafe for ExternalMessagingAdapter
impl Send for ExternalMessagingAdapter
impl Sync for ExternalMessagingAdapter
impl Unpin for ExternalMessagingAdapter
impl UnsafeUnpin for ExternalMessagingAdapter
impl UnwindSafe for ExternalMessagingAdapter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more