pub struct Registry { /* private fields */ }Expand description
The providers a host’s build includes, highest priority first.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Every provider this build includes, in order: SVG, PDF, animated images, Lottie, OpenEXR. Image sequences and LaTeX are opened without one.
Sourcepub fn register(&mut self, provider: Box<dyn VisualProvider>)
pub fn register(&mut self, provider: Box<dyn VisualProvider>)
Adds provider after those already registered.
Sourcepub fn probe(
&self,
bytes: &[u8],
) -> Option<Result<(&'static str, ProbeReport), ExtensionError>>
pub fn probe( &self, bytes: &[u8], ) -> Option<Result<(&'static str, ProbeReport), ExtensionError>>
The first provider that claims bytes and its report, or None. A claiming provider’s
error is returned as is; no other provider is tried.
Sourcepub fn supports(&self, source: &ProviderSource) -> bool
pub fn supports(&self, source: &ProviderSource) -> bool
Whether this build opens source.
Sourcepub const fn reads_image_sequences() -> bool
pub const fn reads_image_sequences() -> bool
Whether this build reads image sequences, which have no registered provider.
Sourcepub const fn reads_latex() -> bool
pub const fn reads_latex() -> bool
Whether this build typesets LaTeX, which reads no file and so has no registered provider.
Sourcepub fn open_needs(&self, source: &ProviderSource) -> Vec<String>
pub fn open_needs(&self, source: &ProviderSource) -> Vec<String>
Locators Self::open reads for source (an image sequence’s first frame).
Sourcepub fn open(
&self,
source: &ProviderSource,
bytes: Option<Arc<[u8]>>,
resolver: SharedResolver,
) -> Result<Box<dyn VisualSource>, ExtensionError>
pub fn open( &self, source: &ProviderSource, bytes: Option<Arc<[u8]>>, resolver: SharedResolver, ) -> Result<Box<dyn VisualSource>, ExtensionError>
Opens a project’s provider source from its bytes (None for an image sequence, whose
frames come from resolver, and for LaTeX, which reads no file).
Renders go through the same panic boundary. After one render panics, every later render fails without running provider code on the state the panic left.
§Errors
ExtensionError::Unsupported without a provider, ExtensionError::Mismatch for
another format, or the provider’s error (ExtensionError::Malformed if it panicked).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Registry
impl !UnwindSafe for Registry
impl Freeze for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().