#[non_exhaustive]pub enum DatasetFormat {
NQuads,
TriG,
}
๐Deprecated since 0.4.0: use RdfFormat instead
Expand description
RDF dataset 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.
NQuads
๐Deprecated since 0.4.0: use RdfFormat instead
TriG
๐Deprecated since 0.4.0: use RdfFormat instead
Implementationsยง
Sourceยงimpl DatasetFormat
impl DatasetFormat
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::DatasetFormat;
assert_eq!(
DatasetFormat::NQuads.iri(),
"http://www.w3.org/ns/formats/N-Quads"
)
Sourcepub fn media_type(self) -> &'static str
pub fn media_type(self) -> &'static str
The format IANA media type.
use oxigraph::io::DatasetFormat;
assert_eq!(DatasetFormat::NQuads.media_type(), "application/n-quads")
Sourcepub fn file_extension(self) -> &'static str
pub fn file_extension(self) -> &'static str
The format IANA-registered file extension.
use oxigraph::io::DatasetFormat;
assert_eq!(DatasetFormat::NQuads.file_extension(), "nq")
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.
Example:
use oxigraph::io::DatasetFormat;
assert_eq!(
DatasetFormat::from_media_type("application/n-quads; charset=utf-8"),
Some(DatasetFormat::NQuads)
)
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::DatasetFormat;
assert_eq!(
DatasetFormat::from_extension("nq"),
Some(DatasetFormat::NQuads)
)
Trait Implementationsยง
Sourceยงimpl Clone for DatasetFormat
impl Clone for DatasetFormat
Sourceยงfn clone(&self) -> DatasetFormat
fn clone(&self) -> DatasetFormat
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 DatasetFormat
impl Debug for DatasetFormat
Sourceยงimpl From<DatasetFormat> for RdfFormat
impl From<DatasetFormat> for RdfFormat
Sourceยงfn from(format: DatasetFormat) -> Self
fn from(format: DatasetFormat) -> Self
Converts to this type from the input type.
Sourceยงimpl From<DatasetFormat> for RdfParser
impl From<DatasetFormat> for RdfParser
Sourceยงfn from(format: DatasetFormat) -> Self
fn from(format: DatasetFormat) -> Self
Converts to this type from the input type.
Sourceยงimpl From<DatasetFormat> for RdfSerializer
impl From<DatasetFormat> for RdfSerializer
Sourceยงfn from(format: DatasetFormat) -> Self
fn from(format: DatasetFormat) -> Self
Converts to this type from the input type.
Sourceยงimpl Hash for DatasetFormat
impl Hash for DatasetFormat
Sourceยงimpl PartialEq for DatasetFormat
impl PartialEq for DatasetFormat
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 DatasetFormat
impl Eq for DatasetFormat
impl StructuralPartialEq for DatasetFormat
Auto Trait Implementationsยง
impl Freeze for DatasetFormat
impl RefUnwindSafe for DatasetFormat
impl Send for DatasetFormat
impl Sync for DatasetFormat
impl Unpin for DatasetFormat
impl UnwindSafe for DatasetFormat
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