pub struct GenerateWebfontsFromSourcesResult { /* private fields */ }Expand description
Font buffers and independently lazy companion renders from SVG text. No method on this result reads or writes files. Settings and templates stay fixed.
Implementations§
Source§impl GenerateWebfontsFromSourcesResult
impl GenerateWebfontsFromSourcesResult
Sourcepub fn add_sync(
&mut self,
source: SvgSource,
variant: Option<&str>,
) -> Result<()>
pub fn add_sync( &mut self, source: SvgSource, variant: Option<&str>, ) -> Result<()>
Append a new source and regenerate. Families require an existing target variant.
Requires incremental generation. Inherits Self::regenerate_sync’s rollback semantics.
Sourcepub fn update_sync(
&mut self,
id: String,
svg: String,
name: Option<String>,
) -> Result<()>
pub fn update_sync( &mut self, id: String, svg: String, name: Option<String>, ) -> Result<()>
Replace an existing source in every consuming design, preserving its position.
An absent name preserves the old name. Inherits Self::regenerate_sync’s rollback semantics.
Sourcepub fn remove_sync(&mut self, id: String) -> Result<()>
pub fn remove_sync(&mut self, id: String) -> Result<()>
Remove an existing ID from every design. Rejects empty designs.
Inherits Self::regenerate_sync’s rollback semantics.
Sourcepub async fn add(
self,
source: SvgSource,
variant: Option<String>,
) -> Result<Self, SourceRegenerateError>
pub async fn add( self, source: SvgSource, variant: Option<String>, ) -> Result<Self, SourceRegenerateError>
Consuming async equivalent of Self::add_sync, with Self::regenerate’s recovery semantics.
Sourcepub async fn update(
self,
id: String,
svg: String,
name: Option<String>,
) -> Result<Self, SourceRegenerateError>
pub async fn update( self, id: String, svg: String, name: Option<String>, ) -> Result<Self, SourceRegenerateError>
Consuming async equivalent of Self::update_sync, with Self::regenerate’s recovery semantics.
Sourcepub async fn remove(self, id: String) -> Result<Self, SourceRegenerateError>
pub async fn remove(self, id: String) -> Result<Self, SourceRegenerateError>
Consuming async equivalent of Self::remove_sync, with Self::regenerate’s recovery semantics.
Sourcepub fn regenerate_sync(
&mut self,
membership: SourceMembership,
changes: Vec<SourceChange>,
) -> Result<()>
pub fn regenerate_sync( &mut self, membership: SourceMembership, changes: Vec<SourceChange>, ) -> Result<()>
Apply a changed-source batch and complete ordered membership synchronously.
Requires incremental: Some(true). On error, buffers, sources and renders remain usable;
a failed build discards partially mutated geometry caches so a retry starts safely.
Sourcepub async fn regenerate(
self,
membership: SourceMembership,
changes: Vec<SourceChange>,
) -> Result<Self, SourceRegenerateError>
pub async fn regenerate( self, membership: SourceMembership, changes: Vec<SourceChange>, ) -> Result<Self, SourceRegenerateError>
Apply Self::regenerate_sync on Tokio’s blocking pool, returning the updated result.
Ordinary failures retain the original usable result in SourceRegenerateError.
Source§impl GenerateWebfontsFromSourcesResult
impl GenerateWebfontsFromSourcesResult
Sourcepub fn svg_string(&self) -> Option<&str>
pub fn svg_string(&self) -> Option<&str>
Borrow the requested SVG font.
Sourcepub fn woff_bytes(&self) -> Option<&[u8]>
pub fn woff_bytes(&self) -> Option<&[u8]>
Borrow the requested WOFF font.
Sourcepub fn woff2_bytes(&self) -> Option<&[u8]>
pub fn woff2_bytes(&self) -> Option<&[u8]>
Borrow the requested WOFF2 font.
Sourcepub fn generate_css(&self) -> Result<Arc<String>>
pub fn generate_css(&self) -> Result<Arc<String>>
Render CSS on first request and share the cached string thereafter. Explicit requests render even when CSS collection is disabled.
Sourcepub fn generate_html(&self) -> Result<Arc<String>>
pub fn generate_html(&self) -> Result<Arc<String>>
Render an HTML preview on first request. Its styles reuse the CSS render cache. Requesting CSS alone never compiles the HTML template.
Sourcepub fn generate_ts(&self) -> Result<Arc<String>>
pub fn generate_ts(&self) -> Result<Arc<String>>
Render a fixed TypeScript source module with icon names and selector settings. Explicit requests work even when TS collection is disabled and never render templates.
Sourcepub fn cache_bytes(&mut self) -> Option<Vec<u8>>
pub fn cache_bytes(&mut self) -> Option<Vec<u8>>
Encode the persistent cache for storage, reflecting the current fonts and sources
(including incremental updates). Returns None when the result was generated without
the cache option, or when the bytes equal
the ones passed in or last returned, so callers can skip rewriting their store.
Sourcepub fn collect_outputs(&self) -> Result<Vec<CollectedOutput>>
pub fn collect_outputs(&self) -> Result<Vec<CollectedOutput>>
Collect fonts and enabled companions, sharing all payloads with this result.
Auto Trait Implementations§
impl !Freeze for GenerateWebfontsFromSourcesResult
impl !RefUnwindSafe for GenerateWebfontsFromSourcesResult
impl !UnwindSafe for GenerateWebfontsFromSourcesResult
impl Send for GenerateWebfontsFromSourcesResult
impl Sync for GenerateWebfontsFromSourcesResult
impl Unpin for GenerateWebfontsFromSourcesResult
impl UnsafeUnpin for GenerateWebfontsFromSourcesResult
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.