#[non_exhaustive]pub enum GraphFormat {
NTriples,
Turtle,
RdfXml,
}
๐Deprecated since 0.4.0: use RdfFormat instead
Expand description
RDF graph serialization formats.
This enumeration is non exhaustive. New formats like JSON-LD will be added in the future.
Variants (Non-exhaustive)ยง
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NTriples
๐Deprecated since 0.4.0: use RdfFormat instead
Turtle
๐Deprecated since 0.4.0: use RdfFormat instead
RdfXml
๐Deprecated since 0.4.0: use RdfFormat instead
Implementationsยง
Sourceยงimpl GraphFormat
impl GraphFormat
Sourcepub fn iri(self) -> &'static str
pub fn iri(self) -> &'static str
The format canonical IRI according to the Unique URIs for file formats registry.
use oxigraph::io::GraphFormat;
assert_eq!(
GraphFormat::NTriples.iri(),
"http://www.w3.org/ns/formats/N-Triples"
)
Sourcepub fn media_type(self) -> &'static str
pub fn media_type(self) -> &'static str
The format IANA media type.
use oxigraph::io::GraphFormat;
assert_eq!(GraphFormat::NTriples.media_type(), "application/n-triples")
Sourcepub fn file_extension(self) -> &'static str
pub fn file_extension(self) -> &'static str
The format IANA-registered file extension.
use oxigraph::io::GraphFormat;
assert_eq!(GraphFormat::NTriples.file_extension(), "nt")
Sourcepub fn from_media_type(media_type: &str) -> Option<Self>
pub fn from_media_type(media_type: &str) -> Option<Self>
Looks for a known format from a media type.
It supports some media type aliases.
For example, โapplication/xmlโ is going to return GraphFormat::RdfXml
even if it is not its canonical media type.
Example:
use oxigraph::io::GraphFormat;
assert_eq!(
GraphFormat::from_media_type("text/turtle; charset=utf-8"),
Some(GraphFormat::Turtle)
)
Sourcepub fn from_extension(extension: &str) -> Option<Self>
pub fn from_extension(extension: &str) -> Option<Self>
Looks for a known format from an extension.
It supports some aliases.
Example:
use oxigraph::io::GraphFormat;
assert_eq!(
GraphFormat::from_extension("nt"),
Some(GraphFormat::NTriples)
)
Trait Implementationsยง
Sourceยงimpl Clone for GraphFormat
impl Clone for GraphFormat
Sourceยงfn clone(&self) -> GraphFormat
fn clone(&self) -> GraphFormat
Returns a copy of the value. Read more
1.0.0 ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSourceยงimpl Debug for GraphFormat
impl Debug for GraphFormat
Sourceยงimpl From<GraphFormat> for RdfFormat
impl From<GraphFormat> for RdfFormat
Sourceยงfn from(format: GraphFormat) -> Self
fn from(format: GraphFormat) -> Self
Converts to this type from the input type.
Sourceยงimpl From<GraphFormat> for RdfParser
impl From<GraphFormat> for RdfParser
Sourceยงfn from(format: GraphFormat) -> Self
fn from(format: GraphFormat) -> Self
Converts to this type from the input type.
Sourceยงimpl From<GraphFormat> for RdfSerializer
impl From<GraphFormat> for RdfSerializer
Sourceยงfn from(format: GraphFormat) -> Self
fn from(format: GraphFormat) -> Self
Converts to this type from the input type.
Sourceยงimpl Hash for GraphFormat
impl Hash for GraphFormat
Sourceยงimpl PartialEq for GraphFormat
impl PartialEq for GraphFormat
Sourceยงimpl TryFrom<DatasetFormat> for GraphFormat
impl TryFrom<DatasetFormat> for GraphFormat
Sourceยงimpl TryFrom<GraphFormat> for DatasetFormat
impl TryFrom<GraphFormat> for DatasetFormat
impl Copy for GraphFormat
impl Eq for GraphFormat
impl StructuralPartialEq for GraphFormat
Auto Trait Implementationsยง
impl Freeze for GraphFormat
impl RefUnwindSafe for GraphFormat
impl Send for GraphFormat
impl Sync for GraphFormat
impl Unpin for GraphFormat
impl UnwindSafe for GraphFormat
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