Uses new rustdoc <div class="warning"> style

pull/617/head
Tpt 1 year ago committed by Thomas Tanon
parent 7fe055d2b4
commit 1eaa77ad93
  1. 5
      lib/oxrdf/src/dataset.rs
  2. 5
      lib/oxrdf/src/graph.rs
  3. 16
      lib/oxrdfio/src/serializer.rs
  4. 2
      lib/oxsdatatypes/src/double.rs
  5. 2
      lib/oxsdatatypes/src/float.rs
  6. 2
      lib/sparesults/src/lib.rs
  7. 4
      lib/src/io/write.rs
  8. 2
      lib/src/sparql/algebra.rs
  9. 34
      lib/src/store.rs

@ -39,8 +39,9 @@ use std::hash::{Hash, Hasher};
/// An in-memory [RDF dataset](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-dataset). /// An in-memory [RDF dataset](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-dataset).
/// ///
/// It can accommodate a fairly large number of quads (in the few millions). /// It can accommodate a fairly large number of quads (in the few millions).
/// Beware: it interns the string and does not do any garbage collection yet: ///
/// if you insert and remove a lot of different terms, memory will grow without any reduction. /// <div class="warning">It interns the strings and does not do any garbage collection yet:
/// if you insert and remove a lot of different terms, memory will grow without any reduction.</div>
/// ///
/// Usage example: /// Usage example:
/// ``` /// ```

@ -29,8 +29,9 @@ use std::fmt;
/// An in-memory [RDF graph](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-graph). /// An in-memory [RDF graph](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-graph).
/// ///
/// It can accommodate a fairly large number of triples (in the few millions). /// It can accommodate a fairly large number of triples (in the few millions).
/// Beware: it interns the string and does not do any garbage collection yet: ///
/// if you insert and remove a lot of different terms, memory will grow without any reduction. /// <div class="warning">It interns the string and does not do any garbage collection yet:
/// if you insert and remove a lot of different terms, memory will grow without any reduction.</div>
/// ///
/// Usage example: /// Usage example:
/// ``` /// ```

@ -62,9 +62,9 @@ impl RdfSerializer {
/// Writes to a [`Write`] implementation. /// Writes to a [`Write`] implementation.
/// ///
/// Warning: Do not forget to run the [`finish`](ToWriteQuadWriter::finish()) method to properly write the last bytes of the file. /// <div class="warning">Do not forget to run the [`finish`](ToWriteQuadWriter::finish()) method to properly write the last bytes of the file.</div>
/// ///
/// Warning: This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that. /// <div class="warning">This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div>
/// ///
/// ``` /// ```
/// use oxrdfio::{RdfFormat, RdfSerializer}; /// use oxrdfio::{RdfFormat, RdfSerializer};
@ -107,9 +107,9 @@ impl RdfSerializer {
/// Writes to a Tokio [`AsyncWrite`] implementation. /// Writes to a Tokio [`AsyncWrite`] implementation.
/// ///
/// Warning: Do not forget to run the [`finish`](ToTokioAsyncWriteQuadWriter::finish()) method to properly write the last bytes of the file. /// <div class="warning">Do not forget to run the [`finish`](ToTokioAsyncWriteQuadWriter::finish()) method to properly write the last bytes of the file.</div>
/// ///
/// Warning: This writer does unbuffered writes. You might want to use [`BufWriter`](tokio::io::BufWriter) to avoid that. /// <div class="warning">This writer does unbuffered writes. You might want to use [`BufWriter`](tokio::io::BufWriter) to avoid that.</div>
/// ///
/// ``` /// ```
/// use oxrdfio::{RdfFormat, RdfSerializer}; /// use oxrdfio::{RdfFormat, RdfSerializer};
@ -163,9 +163,9 @@ impl RdfSerializer {
/// ///
/// Can be built using [`RdfSerializer::serialize_to_write`]. /// Can be built using [`RdfSerializer::serialize_to_write`].
/// ///
/// Warning: Do not forget to run the [`finish`](ToWriteQuadWriter::finish()) method to properly write the last bytes of the file. /// <div class="warning">Do not forget to run the [`finish`](ToWriteQuadWriter::finish()) method to properly write the last bytes of the file.</div>
/// ///
/// Warning: This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that. /// <div class="warning">This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div>
/// ///
/// ``` /// ```
/// use oxrdfio::{RdfFormat, RdfSerializer}; /// use oxrdfio::{RdfFormat, RdfSerializer};
@ -232,9 +232,9 @@ impl<W: Write> ToWriteQuadWriter<W> {
/// ///
/// Can be built using [`RdfSerializer::serialize_to_write`]. /// Can be built using [`RdfSerializer::serialize_to_write`].
/// ///
/// Warning: Do not forget to run the [`finish`](ToWriteQuadWriter::finish()) method to properly write the last bytes of the file. /// <div class="warning">Do not forget to run the [`finish`](ToWriteQuadWriter::finish()) method to properly write the last bytes of the file.</div>
/// ///
/// Warning: This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that. /// <div class="warning">This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div>
/// ///
/// ``` /// ```
/// use oxrdfio::{RdfFormat, RdfSerializer}; /// use oxrdfio::{RdfFormat, RdfSerializer};

@ -9,7 +9,7 @@ use std::str::FromStr;
/// ///
/// Uses internally a [`f64`]. /// Uses internally a [`f64`].
/// ///
/// Beware: serialization is currently buggy and do not follow the canonical mapping yet. /// <div class="warning">Serialization does not follow the canonical mapping.</div>
#[derive(Debug, Clone, Copy, Default, PartialEq)] #[derive(Debug, Clone, Copy, Default, PartialEq)]
#[repr(transparent)] #[repr(transparent)]
pub struct Double { pub struct Double {

@ -9,7 +9,7 @@ use std::str::FromStr;
/// ///
/// Uses internally a [`f32`]. /// Uses internally a [`f32`].
/// ///
/// Beware: serialization is currently buggy and do not follow the canonical mapping yet. /// <div class="warning">Serialization does not follow the canonical mapping.</div>
#[derive(Debug, Clone, Copy, Default, PartialEq)] #[derive(Debug, Clone, Copy, Default, PartialEq)]
#[repr(transparent)] #[repr(transparent)]
pub struct Float { pub struct Float {

@ -479,7 +479,7 @@ impl QueryResultsSerializer {
/// Allows writing query results. /// Allows writing query results.
/// Could be built using a [`QueryResultsSerializer`]. /// Could be built using a [`QueryResultsSerializer`].
/// ///
/// Warning: Do not forget to run the [`finish`](SolutionsWriter::finish()) method to properly write the last bytes of the file. /// <div class="warning">Do not forget to run the [`finish`](SolutionsWriter::finish()) method to properly write the last bytes of the file.</div>
/// ///
/// Example in TSV (the API is the same for JSON and XML): /// Example in TSV (the API is the same for JSON and XML):
/// ``` /// ```

@ -55,7 +55,7 @@ impl GraphSerializer {
/// Allows writing triples. /// Allows writing triples.
/// Could be built using a [`GraphSerializer`]. /// Could be built using a [`GraphSerializer`].
/// ///
/// Warning: Do not forget to run the [`finish`](TripleWriter::finish()) method to properly write the last bytes of the file. /// <div class="warning">Do not forget to run the [`finish`](TripleWriter::finish()) method to properly write the last bytes of the file.</div>
/// ///
/// ``` /// ```
/// use oxigraph::io::{GraphFormat, GraphSerializer}; /// use oxigraph::io::{GraphFormat, GraphSerializer};
@ -138,7 +138,7 @@ impl DatasetSerializer {
/// Allows writing triples. /// Allows writing triples.
/// Could be built using a [`DatasetSerializer`]. /// Could be built using a [`DatasetSerializer`].
/// ///
/// Warning: Do not forget to run the [`finish`](QuadWriter::finish()) method to properly write the last bytes of the file. /// <div class="warning">Do not forget to run the [`finish`](QuadWriter::finish()) method to properly write the last bytes of the file.</div>
/// ///
/// ``` /// ```
/// use oxigraph::io::{DatasetFormat, DatasetSerializer}; /// use oxigraph::io::{DatasetFormat, DatasetSerializer};

@ -1,8 +1,6 @@
//! [SPARQL 1.1 Query Algebra](https://www.w3.org/TR/sparql11-query/#sparqlQuery) //! [SPARQL 1.1 Query Algebra](https://www.w3.org/TR/sparql11-query/#sparqlQuery)
//! //!
//! The root type for SPARQL queries is [`Query`] and the root type for updates is [`Update`]. //! The root type for SPARQL queries is [`Query`] and the root type for updates is [`Update`].
//!
//! Warning: this implementation is an unstable work in progress
use crate::model::*; use crate::model::*;
use crate::sparql::eval::Timer; use crate::sparql::eval::Timer;

@ -213,7 +213,7 @@ impl Store {
/// Executes a [SPARQL 1.1 query](https://www.w3.org/TR/sparql11-query/) with some options and /// Executes a [SPARQL 1.1 query](https://www.w3.org/TR/sparql11-query/) with some options and
/// returns a query explanation with some statistics (if enabled with the `with_stats` parameter). /// returns a query explanation with some statistics (if enabled with the `with_stats` parameter).
/// ///
/// Beware: if you want to compute statistics you need to exhaust the results iterator before having a look at them. /// <div class="warning">If you want to compute statistics you need to exhaust the results iterator before having a look at them.</div>
/// ///
/// Usage example serialising the explanation with statistics in JSON: /// Usage example serialising the explanation with statistics in JSON:
/// ``` /// ```
@ -324,7 +324,7 @@ impl Store {
/// Returns the number of quads in the store. /// Returns the number of quads in the store.
/// ///
/// Warning: this function executes a full scan. /// <div class="warning">This function executes a full scan.</div>
/// ///
/// Usage example: /// Usage example:
/// ``` /// ```
@ -565,7 +565,7 @@ impl Store {
/// Adds atomically a set of quads to this store. /// Adds atomically a set of quads to this store.
/// ///
/// Warning: This operation uses a memory heavy transaction internally, use the [`bulk_loader`](Store::bulk_loader) if you plan to add ten of millions of triples. /// <div class="warning">This operation uses a memory heavy transaction internally, use the [`bulk_loader`](Store::bulk_loader) if you plan to add ten of millions of triples.</div>
pub fn extend( pub fn extend(
&self, &self,
quads: impl IntoIterator<Item = impl Into<Quad>>, quads: impl IntoIterator<Item = impl Into<Quad>>,
@ -815,7 +815,7 @@ impl Store {
/// ///
/// Useful to call after a batch upload or another similar operation. /// Useful to call after a batch upload or another similar operation.
/// ///
/// Warning: Can take hours on huge databases. /// <div class="warning">Can take hours on huge databases.</div>
#[cfg(not(target_family = "wasm"))] #[cfg(not(target_family = "wasm"))]
pub fn optimize(&self) -> Result<(), StorageError> { pub fn optimize(&self) -> Result<(), StorageError> {
self.storage.compact() self.storage.compact()
@ -826,10 +826,10 @@ impl Store {
/// After its creation, the backup is usable using [`Store::open`] /// After its creation, the backup is usable using [`Store::open`]
/// like a regular Oxigraph database and operates independently from the original database. /// like a regular Oxigraph database and operates independently from the original database.
/// ///
/// Warning: Backups are only possible for on-disk databases created using [`Store::open`]. /// <div class="warning">Backups are only possible for on-disk databases created using [`Store::open`].</div>
/// Temporary in-memory databases created using [`Store::new`] are not compatible with RocksDB backup system. /// Temporary in-memory databases created using [`Store::new`] are not compatible with RocksDB backup system.
/// ///
/// Warning: An error is raised if the `target_directory` already exists. /// <div class="warning">An error is raised if the `target_directory` already exists.</div>
/// ///
/// If the target directory is in the same file system as the current database, /// If the target directory is in the same file system as the current database,
/// the database content will not be fully copied /// the database content will not be fully copied
@ -1012,7 +1012,7 @@ impl<'a> Transaction<'a> {
/// Returns the number of quads in the store. /// Returns the number of quads in the store.
/// ///
/// Warning: this function executes a full scan. /// <div class="warning">this function executes a full scan.</div>
pub fn len(&self) -> Result<usize, StorageError> { pub fn len(&self) -> Result<usize, StorageError> {
self.writer.reader().len() self.writer.reader().len()
} }
@ -1364,11 +1364,11 @@ impl Iterator for GraphNameIter {
/// A bulk loader allowing to load at lot of data quickly into the store. /// A bulk loader allowing to load at lot of data quickly into the store.
/// ///
/// Warning: The operations provided here are not atomic. /// <div class="warning">The operations provided here are not atomic.</div>
/// If the operation fails in the middle, only a part of the data may be written to the store. /// If the operation fails in the middle, only a part of the data may be written to the store.
/// Results might get weird if you delete data during the loading process. /// Results might get weird if you delete data during the loading process.
/// ///
/// Warning: It is optimized for speed. /// <div class="warning">It is optimized for speed.</div>
/// Memory usage is configurable using [`BulkLoader::set_max_memory_size_in_megabytes`] /// Memory usage is configurable using [`BulkLoader::set_max_memory_size_in_megabytes`]
/// and the number of used threads with [`BulkLoader::set_num_threads`]. /// and the number of used threads with [`BulkLoader::set_num_threads`].
/// By default the memory consumption target (excluding the system and RocksDB internal consumption) /// By default the memory consumption target (excluding the system and RocksDB internal consumption)
@ -1452,11 +1452,11 @@ impl BulkLoader {
/// ///
/// This function is optimized for large dataset loading speed. For small files, [`Store::load_dataset`] might be more convenient. /// This function is optimized for large dataset loading speed. For small files, [`Store::load_dataset`] might be more convenient.
/// ///
/// Warning: This method is not atomic. /// <div class="warning">This method is not atomic.</div>
/// If the parsing fails in the middle of the file, only a part of it may be written to the store. /// If the parsing fails in the middle of the file, only a part of it may be written to the store.
/// Results might get weird if you delete data during the loading process. /// Results might get weird if you delete data during the loading process.
/// ///
/// Warning: This method is optimized for speed. See [the struct](BulkLoader) documentation for more details. /// <div class="warning">This method is optimized for speed. See [the struct](BulkLoader) documentation for more details.</div>
/// ///
/// Usage example: /// Usage example:
/// ``` /// ```
@ -1510,11 +1510,11 @@ impl BulkLoader {
/// ///
/// This function is optimized for large graph loading speed. For small files, [`Store::load_graph`] might be more convenient. /// This function is optimized for large graph loading speed. For small files, [`Store::load_graph`] might be more convenient.
/// ///
/// Warning: This method is not atomic. /// <div class="warning">This method is not atomic.</div>
/// If the parsing fails in the middle of the file, only a part of it may be written to the store. /// If the parsing fails in the middle of the file, only a part of it may be written to the store.
/// Results might get weird if you delete data during the loading process. /// Results might get weird if you delete data during the loading process.
/// ///
/// Warning: This method is optimized for speed. See [the struct](BulkLoader) documentation for more details. /// <div class="warning">This method is optimized for speed. See [the struct](BulkLoader) documentation for more details.</div>
/// ///
/// Usage example: /// Usage example:
/// ``` /// ```
@ -1570,11 +1570,11 @@ impl BulkLoader {
/// Adds a set of quads using the bulk loader. /// Adds a set of quads using the bulk loader.
/// ///
/// Warning: This method is not atomic. /// <div class="warning">This method is not atomic.</div>
/// If the process fails in the middle of the file, only a part of the data may be written to the store. /// If the process fails in the middle of the file, only a part of the data may be written to the store.
/// Results might get weird if you delete data during the loading process. /// Results might get weird if you delete data during the loading process.
/// ///
/// Warning: This method is optimized for speed. See [the struct](BulkLoader) documentation for more details. /// <div class="warning">This method is optimized for speed. See [the struct](BulkLoader) documentation for more details.</div>
pub fn load_quads( pub fn load_quads(
&self, &self,
quads: impl IntoIterator<Item = impl Into<Quad>>, quads: impl IntoIterator<Item = impl Into<Quad>>,
@ -1584,11 +1584,11 @@ impl BulkLoader {
/// Adds a set of quads using the bulk loader while breaking in the middle of the process in case of error. /// Adds a set of quads using the bulk loader while breaking in the middle of the process in case of error.
/// ///
/// Warning: This method is not atomic. /// <div class="warning">This method is not atomic.</div>
/// If the process fails in the middle of the file, only a part of the data may be written to the store. /// If the process fails in the middle of the file, only a part of the data may be written to the store.
/// Results might get weird if you delete data during the loading process. /// Results might get weird if you delete data during the loading process.
/// ///
/// Warning: This method is optimized for speed. See [the struct](BulkLoader) documentation for more details. /// <div class="warning">This method is optimized for speed. See [the struct](BulkLoader) documentation for more details.</div>
pub fn load_ok_quads<EI, EO: From<StorageError> + From<EI>>( pub fn load_ok_quads<EI, EO: From<StorageError> + From<EI>>(
&self, &self,
quads: impl IntoIterator<Item = Result<impl Into<Quad>, EI>>, quads: impl IntoIterator<Item = Result<impl Into<Quad>, EI>>,

Loading…
Cancel
Save