pub struct TagResolver {
directives: HashMap<String, String>,
handlers: HashMap<String, Box<dyn TagHandler>>,
schema: Schema,
}Expand description
Tag resolution context
Fields§
§directives: HashMap<String, String>Tag directives (handle -> prefix)
handlers: HashMap<String, Box<dyn TagHandler>>Custom tag handlers
schema: SchemaDefault schema
Implementations§
Source§impl TagResolver
impl TagResolver
Sourcepub fn with_schema(schema: Schema) -> Self
pub fn with_schema(schema: Schema) -> Self
Create a new tag resolver with specific schema
Sourcepub fn add_directive(&mut self, handle: String, prefix: String)
pub fn add_directive(&mut self, handle: String, prefix: String)
Add a tag directive
Sourcepub fn clear_directives(&mut self)
pub fn clear_directives(&mut self)
Clear all tag directives
Sourcepub fn register_handler(
&mut self,
tag_uri: String,
handler: Box<dyn TagHandler>,
)
pub fn register_handler( &mut self, tag_uri: String, handler: Box<dyn TagHandler>, )
Register a custom tag handler
Sourcefn identify_tag_kind(uri: &str) -> TagKind
fn identify_tag_kind(uri: &str) -> TagKind
Identify the kind of tag from its URI
Sourcefn construct_bool(&self, value: &str) -> Result<Value>
fn construct_bool(&self, value: &str) -> Result<Value>
Construct a boolean from a tagged value
Sourcefn construct_int(&self, value: &str) -> Result<Value>
fn construct_int(&self, value: &str) -> Result<Value>
Construct an integer from a tagged value
Sourcefn construct_float(&self, value: &str) -> Result<Value>
fn construct_float(&self, value: &str) -> Result<Value>
Construct a float from a tagged value
Sourcefn construct_binary(&self, value: &str) -> Result<Value>
fn construct_binary(&self, value: &str) -> Result<Value>
Construct binary data from a tagged value (base64)
Sourcefn construct_timestamp(&self, value: &str) -> Result<Value>
fn construct_timestamp(&self, value: &str) -> Result<Value>
Construct a timestamp from a tagged value
Trait Implementations§
Source§impl Debug for TagResolver
impl Debug for TagResolver
Auto Trait Implementations§
impl Freeze for TagResolver
impl !RefUnwindSafe for TagResolver
impl Send for TagResolver
impl Sync for TagResolver
impl Unpin for TagResolver
impl !UnwindSafe for TagResolver
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