Skip to main content

PlatformAdapter

Trait PlatformAdapter 

Source
pub trait PlatformAdapter: Send + Sync {
Show 16 methods // Required methods fn id(&self) -> &'static str; fn name(&self) -> &'static str; fn required_format(&self) -> OutputFormat; fn asset_strategy(&self) -> AssetStrategy; fn validate_config(&self, config: &PlatformConfig) -> Result<(), Error>; fn specialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, document: Document, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn check_status<'life0, 'life1, 'async_trait>( &'life0 self, slug: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; // Provided methods fn default_config(&self) -> ResolvedConfigDefaults { ... } fn render_config(&self, _content_info: &ContentInfo) -> RenderConfig { ... } fn supports_shared_link_rewrite(&self) -> bool { ... } fn provision_target<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait { ... } fn upload_assets<'life0, 'life1, 'async_trait>( &'life0 self, _pending: &'life1 PendingAssetList, ) -> Pin<Box<dyn Future<Output = Result<HashMap<usize, String>, Error>> + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait { ... } fn materialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait { ... } fn serialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait { ... } fn publish_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<PublishResult, Error>> + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait { ... } fn build_preview( &self, title: &str, document: Document, ctx: &dyn AdapterContext, ) -> Result<PathBuf, Error> { ... }
}
Expand description

Trait for platform adapters.

Required Methods§

Source

fn id(&self) -> &'static str

Source

fn name(&self) -> &'static str

Source

fn required_format(&self) -> OutputFormat

Source

fn asset_strategy(&self) -> AssetStrategy

Source

fn validate_config(&self, config: &PlatformConfig) -> Result<(), Error>

Source

fn specialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, document: Document, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn check_status<'life0, 'life1, 'async_trait>( &'life0 self, slug: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Provided Methods§

Source

fn default_config(&self) -> ResolvedConfigDefaults

Source

fn render_config(&self, _content_info: &ContentInfo) -> RenderConfig

Source

fn provision_target<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn upload_assets<'life0, 'life1, 'async_trait>( &'life0 self, _pending: &'life1 PendingAssetList, ) -> Pin<Box<dyn Future<Output = Result<HashMap<usize, String>, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn materialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn serialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn publish_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<PublishResult, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn build_preview( &self, title: &str, document: Document, ctx: &dyn AdapterContext, ) -> Result<PathBuf, Error>

Implementations on Foreign Types§

Source§

impl PlatformAdapter for AstroAdapter

Source§

fn id(&self) -> &'static str

Source§

fn name(&self) -> &'static str

Source§

fn required_format(&self) -> OutputFormat

Source§

fn asset_strategy(&self) -> AssetStrategy

Source§

fn validate_config(&self, _config: &PlatformConfig) -> Result<(), Error>

Source§

fn render_config(&self, _content_info: &ContentInfo) -> RenderConfig

Source§

fn specialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, elements: Document, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, AstroAdapter: 'async_trait,

Source§

fn materialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, AstroAdapter: 'async_trait,

Source§

fn serialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, _ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, AstroAdapter: 'async_trait,

Source§

fn publish_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, _ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<PublishResult, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, AstroAdapter: 'async_trait,

Source§

fn build_preview( &self, _title: &str, elements: Document, ctx: &dyn AdapterContext, ) -> Result<PathBuf, Error>

Source§

fn check_status<'life0, 'life1, 'async_trait>( &'life0 self, slug: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, AstroAdapter: 'async_trait,

Source§

impl PlatformAdapter for CopyPasteAdapter

Copypaste adapters support internal link rewriting via cross-platform resolution.

Source§

fn specialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, elements: Document, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, CopyPasteAdapter: 'async_trait,

Stage 5 (Specialize): resolve image URLs and flatten SVGs in AST.

Source§

fn materialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, CopyPasteAdapter: 'async_trait,

Stage 7 (Materialize): upload assets for External strategy. Per [[RFC-0004:C-PIPELINE-INTEGRATION]]

Source§

fn serialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, CopyPasteAdapter: 'async_trait,

Stage 8 (Serialize): convert AST to target format (styled HTML or Markdown).

Source§

fn build_preview( &self, title: &str, elements: Document, ctx: &dyn AdapterContext, ) -> Result<PathBuf, Error>

Build preview from pre-parsed AST (used by unified pipeline).

Receives AST that has already been parsed and transformed by shared pipeline stages. Applies copypaste-specific transforms (SVG flattening, theming) and generates preview.

Source§

fn id(&self) -> &'static str

Source§

fn name(&self) -> &'static str

Source§

fn required_format(&self) -> OutputFormat

Source§

fn asset_strategy(&self) -> AssetStrategy

Source§

fn validate_config(&self, _config: &PlatformConfig) -> Result<(), Error>

Source§

fn render_config(&self, _content_info: &ContentInfo) -> RenderConfig

Source§

fn publish_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, _ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<PublishResult, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, CopyPasteAdapter: 'async_trait,

Source§

fn check_status<'life0, 'life1, 'async_trait>( &'life0 self, slug: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, CopyPasteAdapter: 'async_trait,

Source§

impl PlatformAdapter for GhostAdapter

Source§

fn id(&self) -> &'static str

Source§

fn name(&self) -> &'static str

Source§

fn required_format(&self) -> OutputFormat

Source§

fn asset_strategy(&self) -> AssetStrategy

Source§

fn validate_config(&self, _config: &PlatformConfig) -> Result<(), Error>

Source§

fn render_config(&self, _content_info: &ContentInfo) -> RenderConfig

Source§

fn specialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, elements: Document, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, GhostAdapter: 'async_trait,

Source§

fn materialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, GhostAdapter: 'async_trait,

Source§

fn serialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, _ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, GhostAdapter: 'async_trait,

Source§

fn publish_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<PublishResult, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, GhostAdapter: 'async_trait,

Source§

fn build_preview( &self, _title: &str, elements: Document, ctx: &dyn AdapterContext, ) -> Result<PathBuf, Error>

Source§

fn check_status<'life0, 'life1, 'async_trait>( &'life0 self, _slug: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, GhostAdapter: 'async_trait,

Source§

impl PlatformAdapter for NotionAdapter

Source§

fn id(&self) -> &'static str

Source§

fn name(&self) -> &'static str

Source§

fn required_format(&self) -> OutputFormat

Source§

fn asset_strategy(&self) -> AssetStrategy

Source§

fn render_config(&self, _content_info: &ContentInfo) -> RenderConfig

Source§

fn validate_config(&self, _config: &PlatformConfig) -> Result<(), Error>

Source§

fn specialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, document: Document, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, NotionAdapter: 'async_trait,

Source§

fn provision_target<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, _ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, NotionAdapter: 'async_trait,

Source§

fn materialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, NotionAdapter: 'async_trait,

Source§

fn serialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, _ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, NotionAdapter: 'async_trait,

Source§

fn publish_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, _ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<PublishResult, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, NotionAdapter: 'async_trait,

Source§

fn build_preview( &self, _title: &str, elements: Document, ctx: &dyn AdapterContext, ) -> Result<PathBuf, Error>

Source§

fn check_status<'life0, 'life1, 'async_trait>( &'life0 self, _slug: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, NotionAdapter: 'async_trait,

Source§

impl PlatformAdapter for StaticAdapter

Source§

fn id(&self) -> &'static str

Source§

fn name(&self) -> &'static str

Source§

fn required_format(&self) -> OutputFormat

Source§

fn asset_strategy(&self) -> AssetStrategy

Source§

fn validate_config(&self, _config: &PlatformConfig) -> Result<(), Error>

Source§

fn render_config(&self, _content_info: &ContentInfo) -> RenderConfig

Source§

fn specialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, elements: Document, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, StaticAdapter: 'async_trait,

Source§

fn materialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, StaticAdapter: 'async_trait,

Source§

fn serialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, StaticAdapter: 'async_trait,

Source§

fn publish_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, _ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<PublishResult, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, StaticAdapter: 'async_trait,

Source§

fn build_preview( &self, _title: &str, elements: Document, ctx: &dyn AdapterContext, ) -> Result<PathBuf, Error>

Source§

fn check_status<'life0, 'life1, 'async_trait>( &'life0 self, slug: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, StaticAdapter: 'async_trait,

Source§

impl PlatformAdapter for WordPressAdapter

Source§

fn id(&self) -> &'static str

Source§

fn name(&self) -> &'static str

Source§

fn required_format(&self) -> OutputFormat

Source§

fn asset_strategy(&self) -> AssetStrategy

Source§

fn validate_config(&self, config: &PlatformConfig) -> Result<(), Error>

Source§

fn render_config(&self, _content_info: &ContentInfo) -> RenderConfig

Source§

fn specialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, elements: Document, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, WordPressAdapter: 'async_trait,

Source§

fn upload_assets<'life0, 'life1, 'async_trait>( &'life0 self, pending: &'life1 PendingAssetList, ) -> Pin<Box<dyn Future<Output = Result<HashMap<usize, String>, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, WordPressAdapter: 'async_trait,

Source§

fn materialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, WordPressAdapter: 'async_trait,

Source§

fn serialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, _ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, WordPressAdapter: 'async_trait,

Source§

fn publish_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<PublishResult, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, WordPressAdapter: 'async_trait,

Source§

fn build_preview( &self, _title: &str, elements: Document, ctx: &dyn AdapterContext, ) -> Result<PathBuf, Error>

Source§

fn check_status<'life0, 'life1, 'async_trait>( &'life0 self, slug: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, WordPressAdapter: 'async_trait,

Source§

impl PlatformAdapter for XiaohongshuAdapter

Source§

fn id(&self) -> &'static str

Source§

fn name(&self) -> &'static str

Source§

fn required_format(&self) -> OutputFormat

Source§

fn asset_strategy(&self) -> AssetStrategy

Source§

fn validate_config(&self, _config: &PlatformConfig) -> Result<(), Error>

Source§

fn render_config(&self, content_info: &ContentInfo) -> RenderConfig

Source§

fn specialize_payload<'life0, 'life1, 'async_trait>( &'life0 self, _elements: Document, ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<AdapterPayload, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, XiaohongshuAdapter: 'async_trait,

Source§

fn publish_payload<'life0, 'life1, 'async_trait>( &'life0 self, payload: AdapterPayload, _ctx: &'life1 dyn AdapterContext, ) -> Pin<Box<dyn Future<Output = Result<PublishResult, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, XiaohongshuAdapter: 'async_trait,

Source§

fn build_preview( &self, _title: &str, _elements: Document, ctx: &dyn AdapterContext, ) -> Result<PathBuf, Error>

Source§

fn check_status<'life0, 'life1, 'async_trait>( &'life0 self, slug: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, XiaohongshuAdapter: 'async_trait,

Implementors§