Skip to main content

_xmlSAXHandler

Struct _xmlSAXHandler 

Source
#[repr(C)]
pub struct _xmlSAXHandler {
Show 32 fields pub internalSubset: internalSubsetSAXFunc, pub isStandalone: isStandaloneSAXFunc, pub hasInternalSubset: hasInternalSubsetSAXFunc, pub hasExternalSubset: hasExternalSubsetSAXFunc, pub resolveEntity: resolveEntitySAXFunc, pub getEntity: getEntitySAXFunc, pub entityDecl: entityDeclSAXFunc, pub notationDecl: notationDeclSAXFunc, pub attributeDecl: attributeDeclSAXFunc, pub elementDecl: elementDeclSAXFunc, pub unparsedEntityDecl: unparsedEntityDeclSAXFunc, pub setDocumentLocator: setDocumentLocatorSAXFunc, pub startDocument: startDocumentSAXFunc, pub endDocument: endDocumentSAXFunc, pub startElement: startElementSAXFunc, pub endElement: endElementSAXFunc, pub reference: referenceSAXFunc, pub characters: charactersSAXFunc, pub ignorableWhitespace: ignorableWhitespaceSAXFunc, pub processingInstruction: processingInstructionSAXFunc, pub comment: commentSAXFunc, pub warning: warningSAXFunc, pub error: errorSAXFunc, pub fatalError: fatalErrorSAXFunc, pub getParameterEntity: getParameterEntitySAXFunc, pub cdataBlock: cdataBlockSAXFunc, pub externalSubset: externalSubsetSAXFunc, pub initialized: c_uint, pub _private: *mut c_void, pub startElementNs: startElementNsSAX2Func, pub endElementNs: endElementNsSAX2Func, pub serror: xmlStructuredErrorFunc,
}
Expand description

Callbacks for SAX parser

For DTD-related handlers, it’s recommended to either use the original libxml2 handler or set them to NULL if DTDs can be ignored.

Fields§

§internalSubset: internalSubsetSAXFunc

Called after the start of the document type declaration was parsed.

Should typically not be modified.

§isStandalone: isStandaloneSAXFunc

Standalone status. Not invoked by the parser. Not supposed to be changed by applications.

§hasInternalSubset: hasInternalSubsetSAXFunc

Internal subset availability. Not invoked by the parser. Not supposed to be changed by applications.

§hasExternalSubset: hasExternalSubsetSAXFunc

External subset availability. Not invoked by the parser. Not supposed to be changed by applications.

§resolveEntity: resolveEntitySAXFunc

Only called when loading external DTDs. Not called to load external entities.

Should typically not be modified.

§getEntity: getEntitySAXFunc

Called when looking up general entities.

Should typically not be modified.

§entityDecl: entityDeclSAXFunc

Called after an entity declaration was parsed.

Should typically not be modified.

§notationDecl: notationDeclSAXFunc

Called after a notation declaration was parsed.

Should typically not be modified.

§attributeDecl: attributeDeclSAXFunc

Called after an attribute declaration was parsed.

Should typically not be modified.

§elementDecl: elementDeclSAXFunc

Called after an element declaration was parsed.

Should typically not be modified.

§unparsedEntityDecl: unparsedEntityDeclSAXFunc

Called after an unparsed entity declaration was parsed.

Should typically not be modified.

§setDocumentLocator: setDocumentLocatorSAXFunc

This callback receives the “document locator” at startup, which is always the global xmlDefaultSAXLocator.

Everything is available on the context, so this is useless in our case.

§startDocument: startDocumentSAXFunc

Called after the XML declaration was parsed.

Use xmlCtxtGetVersion(), xmlCtxtGetDeclaredEncoding() and xmlCtxtGetStandalone() to get data from the XML declaration.

§endDocument: endDocumentSAXFunc

Called at the end of the document.

§startElement: startElementSAXFunc

Legacy start tag handler

startElement and endElement are only used by the legacy SAX1 interface and should not be used in new software. If you really have to enable SAX1, the preferred way is set the initialized member to 1 instead of XML_SAX2_MAGIC.

For backward compatibility, it’s also possible to set the startElementNs and endElementNs handlers to NULL.

You can also set the XML_PARSE_SAX1 parser option, but versions older than 2.12.0 will probably crash if this option is provided together with custom SAX callbacks.

§endElement: endElementSAXFunc

See _xmlSAXHandler.startElement

§reference: referenceSAXFunc

Called after an entity reference was parsed.

§characters: charactersSAXFunc

Called after a character data was parsed.

§ignorableWhitespace: ignorableWhitespaceSAXFunc

Called after “ignorable” whitespace was parsed.

ignorableWhitespace should always be set to the same value as characters. Otherwise, the parser will try to detect whitespace which is unreliable.

§processingInstruction: processingInstructionSAXFunc

Called after a processing instruction was parsed.

§comment: commentSAXFunc

Called after a comment was parsed.

§warning: warningSAXFunc

Callback for warning messages.

§error: errorSAXFunc

Callback for error messages.

§fatalError: fatalErrorSAXFunc

Unused, all errors go to error.

§getParameterEntity: getParameterEntitySAXFunc

Called when looking up parameter entities.

Should typically not be modified.

§cdataBlock: cdataBlockSAXFunc

Called after a CDATA section was parsed.

§externalSubset: externalSubsetSAXFunc

Called to parse the external subset.

Should typically not be modified.

§initialized: c_uint

Legacy magic value

initialized should always be set to XML_SAX2_MAGIC to enable the modern SAX2 interface.

§_private: *mut c_void

Application data

§startElementNs: startElementNsSAX2Func

Called after a start tag was parsed.

§endElementNs: endElementNsSAX2Func

Called after an end tag was parsed.

§serror: xmlStructuredErrorFunc

Structured error handler.

Takes precedence over error or warning, but modern code should use xmlCtxtSetErrorHandler().

Trait Implementations§

Source§

impl Clone for _xmlSAXHandler

Source§

fn clone(&self) -> _xmlSAXHandler

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for _xmlSAXHandler

Source§

impl Debug for _xmlSAXHandler

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.