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§
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 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>
Implementations on Foreign Types§
Source§impl PlatformAdapter for AstroAdapter
impl PlatformAdapter for AstroAdapter
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 render_config(&self, _content_info: &ContentInfo) -> RenderConfig
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,
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,
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,
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,
fn build_preview( &self, _title: &str, elements: Document, ctx: &dyn AdapterContext, ) -> Result<PathBuf, Error>
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
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,
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,
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,
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>
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.