pub struct ExternalSocialAdapter { /* private fields */ }Expand description
Social media 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 ExternalSocialAdapter
impl ExternalSocialAdapter
Sourcepub fn new(manifest: &SocialPluginManifest) -> Self
pub fn new(manifest: &SocialPluginManifest) -> Self
Create a new adapter from a discovered plugin manifest.
Sourcepub fn create_draft(
&self,
post: SocialPostContent,
) -> Result<String, SocialPluginError>
pub fn create_draft( &self, post: SocialPostContent, ) -> Result<String, SocialPluginError>
Create a draft in the platform’s native draft state.
Returns the platform-assigned draft ID (e.g., “linkedin-draft-abc123”).
NOTE: There is intentionally no publish method on this type.
TA never publishes social media posts on behalf of the user.
Sourcepub fn create_scheduled(
&self,
post: SocialPostContent,
scheduled_at: &str,
) -> Result<(String, String), SocialPluginError>
pub fn create_scheduled( &self, post: SocialPostContent, scheduled_at: &str, ) -> Result<(String, String), SocialPluginError>
Schedule a post at a future time.
Returns (scheduled_id, confirmed_scheduled_at).
The platform (or its scheduler) controls the actual publication.
Sourcepub fn draft_status(
&self,
draft_id: &str,
) -> Result<SocialPostState, SocialPluginError>
pub fn draft_status( &self, draft_id: &str, ) -> Result<SocialPostState, SocialPluginError>
Poll the current state of a previously created draft or scheduled post.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExternalSocialAdapter
impl RefUnwindSafe for ExternalSocialAdapter
impl Send for ExternalSocialAdapter
impl Sync for ExternalSocialAdapter
impl Unpin for ExternalSocialAdapter
impl UnsafeUnpin for ExternalSocialAdapter
impl UnwindSafe for ExternalSocialAdapter
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