Skip to main content

GenerateWebfontsFromSourcesResult

Struct GenerateWebfontsFromSourcesResult 

Source
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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub async fn remove(self, id: String) -> Result<Self, SourceRegenerateError>

Consuming async equivalent of Self::remove_sync, with Self::regenerate’s recovery semantics.

Source

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.

Source

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

Source

pub fn svg_string(&self) -> Option<&str>

Borrow the requested SVG font.

Source

pub fn ttf_bytes(&self) -> Option<&[u8]>

Borrow the requested TTF font.

Source

pub fn eot_bytes(&self) -> Option<&[u8]>

Borrow the requested EOT font.

Source

pub fn woff_bytes(&self) -> Option<&[u8]>

Borrow the requested WOFF font.

Source

pub fn woff2_bytes(&self) -> Option<&[u8]>

Borrow the requested WOFF2 font.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn collect_outputs(&self) -> Result<Vec<CollectedOutput>>

Collect fonts and enabled companions, sharing all payloads with this result.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

Source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
Source§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

Source§

fn to_owned_table(&self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool