Skip to content

Releases: Marcono1234/struson

Struson 0.7.2

10 Feb 20:08

Choose a tag to compare

Changes

  • Fixed docs.rs build

There are no other changes; from a user perspective this is identical to Struson 0.7.1.

Struson 0.7.1

10 Feb 19:42

Choose a tag to compare

Changes

  • Minimum Rust version (MSRV) is now 1.85.0; the project now uses Rust 2024 Edition
  • JsonStreamWriter does not perform any buffering anymore
    Depending on the use case a std::io::BufWriter should be used, for example when writing to a file or a network connection. It is still necessary to call JsonStreamWriter::finish_document() when writing is done.
  • Added JsonStreamWriter::finish_document_no_flush()
    This allows avoiding the call to flush on the underlying Write (#153).
  • Switched dependency from serde to serde_core
    Only affects users of the serde feature of Struson. This change should not have any effect on the Struson API or your usage of Struson, but it can improve the build time.

Note

Version 0.7.1 is identical to version 0.7.0; there was a problem with the publishing workflow which is why the version bump commit and the Git tag for 0.7.0 are missing from the repository.

Struson 0.6.0

26 Nov 23:19

Choose a tag to compare

Changes

  • Specified the rust-version in Cargo.toml (Minimum Supported Rust Version); currently it is 1.75.0
  • Changed JsonStreamReader to disallow control characters in comments (if enabled with ReaderSettings::allow_comments)
  • Removed deprecated parse_json_path function, use the json_path! macro instead
  • Added associated type WriterResult to JsonWriter, which is returned by JsonWriter::finish_document
    For JsonStreamWriter the result is the underlying Write, which allows for example to reuse it for different purposes.

Simple API

  • (Breaking) Renamed Cargo feature for enabling Simple API from experimental to simple-api
  • Added ObjectWriter::write_member to allow writing the value of a member using a ValueWriter

Struson 0.5.0

17 Mar 12:46

Choose a tag to compare

Changes

  • Added support for trailing comma for json_path!
  • Fixed json_path! not using full type path when creating empty array
    (could probably have lead to compilation errors if JsonPathPiece had not been imported)
  • Fixed UnexpectedStructureKind::to_string not including field values
  • Added JsonReader::seek_back as opposite of seek_to (#53)

Simple API

  • (Breaking) Removed structs ArrayItemReader and MemberValueReader in favor of the new common struct SingleValueReader
  • Reader and writer will keep returning errors after the first error (#55)
    This is intended as safeguard in case an error is accidentally not propagated by a closure or function provided by the user. However, users should not rely on this behavior, and instead use Rust's ? operator for propagating reader and writer errors.
  • New ValueReader methods:
    • read_str for reading a JSON string value as borrowed str
    • read_seeked and read_seeked_multi for making it easier to seek to values and read them (#48, #49)
      Especially read_seeked_multi can be quite useful for reading for example all values of nested JSON arrays or objects; see its documentation for examples.
    • read_string_with_reader for reading large string values in a streaming way (#54)
  • New ValueWriter methods:
    • write_string_with_writer for writing large string values in a streaming way (#54)

Struson 0.4.1

30 Jan 20:54

Choose a tag to compare

Changes

Serde serialization:

  • Fixed spurious SerializerError::IncorrectElementsCount when skipping fields (#41)

Struson 0.4.0

21 Jan 20:00

Choose a tag to compare

Breaking changes

  • Marked some error enum types as non_exhaustive
  • struson::serde::DeserializerError enum variants ParseIntError and ParseFloatError have been replaced with new variant InvalidNumber
  • ReaderError::IoError variant has been changed to a struct which now includes the error location
  • Improved JsonErrorLocation structure; renamed it to JsonReaderPosition
  • Changed return type of JsonReader::next_string_reader and JsonWriter::string_value_writer to use impl Trait (#18)
    When using those methods it might be necessary to add additional use declarations for Read and for Write and StringValueWriter.

Major changes

  • Experimental "simple API" (#34)
    API enforces correct usage at compile time, instead of panicking at runtime (as done by JsonReader and JsonWriter).
    Feedback is highly appreciated!

Changes

  • Adjusted Serde integration to match serde_json 1.0.111 behavior (with some minor differences)
  • JsonStreamReader now keeps retrying to read data in case an error of kind ErrorKind::Interrupted occurs
    This is consistent with the current behavior of JsonStreamWriter, and avoids reading potentially incorrect data when using default methods such as Read::read_exact on the string value reader returned by JsonReader::next_string_reader().
  • Improve string value reader (JsonReader::next_string_reader()) and string value writer (JsonWriter::string_value_writer()) error behavior
    Now when an error occurs, any subsequent read and write attempts will return an error as well.
  • Included Cargo.lock in repository
  • Fixed line number for TrailingCommaNotEnabled syntax error being incorrect if line breaks are after comma
  • Added tracking of byte position for JsonStreamReader
  • Added JsonReader::current_position(...) method for obtaining the current position of the JSON reader (#14)
  • Added JsonStreamReader::reader_mut() for obtaining reference to underlying reader (#25)
  • Added nesting limit for JsonStreamReader (#28)
  • Added support for no arguments for json_path!

Struson 0.3.0

05 Sep 23:01

Choose a tag to compare

Breaking changes

  • Changed number traits used by JsonWriter methods number_value and fp_number_value
    This most likely only affects custom JsonWriter implementations. See below for details.

Changes

  • Fixed JsonStreamReader::next_name sometimes returning wrong results (#10)
  • Added StringValueWriter::write_str
  • Tried to improve number reading and number string writing performance
  • Tried to improve JsonStreamReader::transfer_to performance for string values
  • Adjusted number traits used by JsonWriter methods number_value and fp_number_value
    These changes are mainly relevant for custom implementations of JsonWriter.
    • IntegralNumber has been renamed to FiniteNumber to better describe its behavior
    • Number traits no longer have ToString and Copy as supertraits; instead they have a new use_json_number method to consume a str
    • Number traits have new methods to obtain the value as u64 / i64, respectively f64

Struson 0.2.0

06 Aug 18:57

Choose a tag to compare

Breaking changes

  • Removed ReaderSettings::update_path_during_skip; use the new ReaderSettings::track_path to completely disable path tracking instead
  • The return type of JsonReader::next_name has changed from String to str; use the new method next_name_owned to directly obtain a String

Changes

  • Added ReaderSettings::track_path to allow disabling path tracking for better performance
  • Added JsonReader methods for reading values as str; if only a str is needed these methods will be more performant memory-wise than the methods returning a String
    • next_name (the existing next_name method has been renamed to next_name_owned)
    • next_str
    • next_number_as_str

Struson 0.1.0

22 Apr 15:09

Choose a tag to compare

Initial release