pub struct Registry { /* private fields */ }Implementations§
Source§impl Registry
impl Registry
pub fn new() -> Registry
Sourcepub fn register_parse(
&mut self,
cap: Arc<dyn ParseCapability>,
delegate_to: Option<&str>,
) -> Result<(), RegistryError>
pub fn register_parse( &mut self, cap: Arc<dyn ParseCapability>, delegate_to: Option<&str>, ) -> Result<(), RegistryError>
注册解析后端;同一声明的多个 format 共享同一 Arc。
pub fn register_process(&mut self, cap: Arc<dyn ProcessCapability>)
pub fn register_plugin(&mut self, plugin: Arc<dyn FormatPlugin>)
Sourcepub fn plugin_for(&self, fmt: &str) -> Option<Arc<dyn FormatPlugin>>
pub fn plugin_for(&self, fmt: &str) -> Option<Arc<dyn FormatPlugin>>
按格式找插件。
Sourcepub fn resolve_parse_chain(
&self,
fmt: &str,
policy: &BackendPolicy,
default: &[&str],
) -> Vec<Arc<dyn ParseCapability>>
pub fn resolve_parse_chain( &self, fmt: &str, policy: &BackendPolicy, default: &[&str], ) -> Vec<Arc<dyn ParseCapability>>
解析该格式可尝试的解析后端链(过滤不可用项)。
pub fn resolve_process_chain( &self, policy: &BackendPolicy, default: &[&str], ) -> Vec<Arc<dyn ProcessCapability>>
pub fn list_backends(&self) -> Vec<String>
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
Mutably borrows from an owned value. Read more
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> ⓘ
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 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> ⓘ
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