bindgen
has been updated from 0.59 to 0.68.
- Various broken intra-doc links have been fixed.
- The doc-example for str2zwr has been extended to also work in non-UTF8 mode.
- The build script for YDBRust is now compatible with bindgen 0.63+.
- Added [
Key::last_mut
], which is a shorter and non-panicking version of&mut key[key.len() - 1]
.
-
The
simple_api
is now private. We recommend using thecontext_api
instead.Most functions in the simple_api had one of two forms: either free functions, or associated functions of
Key
. For free functions, you can replace your calls with a call toContext
:// previous code let serialized = yottadb::simple_api::str2zwr_st(TpToken::default(), Vec::new(), "💖".as_bytes()); // new code let ctx = yottadb::Context::new(); let serialized = ctx.str2zwr("💖".as_bytes());
For functions on
Key
, you can useKeyContext
instead:// previous code let key = yottadb::simple_api::Key::variable("^hello"); let value = key.get_st(TpToken::default(), Vec::new())?; // new code let ctx = yottadb::Context::new(); let key = yottadb::KeyContext::variable(&ctx, "^hello"); let value = key.get()?;
-
The
tptoken
field ofYDBError
is now private. This prevents infinite hangs, aborts, or other bugs when callingerror.to_string()
on an error with an invalid tptoken. As a side effect,YDBError
cannot be constructed outside of theyottadb
crate. -
The
context_api
module is now hidden from the documentation and its items are re-exported at the crate root; we recommend using the top-level items instead. However, it still remains public to make migration to 2.0 easier. -
KeyContext::next_sub
andprev_sub
now return aVec<u8>
buffer instead of a fullKeyContext
. To replicate the old behavior, you can use this snippet:
let mut new_key = key.clone();
new_key.next_sub_self()?;
Context::zwr2str
no longer requires anout_buffer
parameter.
-
The following functions can no longer cause memory corruption when resizing buffers (!118):
See the test case for details about exactly how this could break before.
-
impl Error for YDBError
no longer returns itself infn cause()
. This avoids infinite loops when iterating over the source of an error. !115 -
Returning a
YDBError
from inside a transaction no longer discards the error buffer. Previously, the error buffer would always be shown as empty even if an error occurred. !121 -
The test suite is now thread-safe. Note that this is only changed the test suite, the main YDBRust API has always been thread-safe. !112
yottadb
no longer requires compilingbindgen
from source (when passed--no-default-features
). See !101 for details.KeyContext
now implementsAddAssign
as a shortcut forincrement()
. !113u64
now implementsFrom<Tptoken>
. Previously,u64::from(tptoken)
would be a compile error even thoughlet u: u64 = tptoken.into()
worked correctly. !122- Various
Debug
implementations are more readable. !111
- The minimum supported Rust version (MSRV) has been increased to 1.40. !110
- Errors for transactions are now required to implement
Send
andSync
. !99 - Various dependencies have been updated. !110
ci_t!
andci_t_p!
can no longer loop forever if passed an output buffer with insufficient capacity (!98)- Several broken links in the documentation have been fixed (!95)
-
Types shared between the
context_api
andsimple_api
, such asYDBError
, are now re-exported at the top level (!40) -
The following C Simple API functions are now exposed:
-
Added
release_st
(!68) printing the version of the Rust wrapper -
Added compatibility with Rust 1.34 (!75)
-
tp_st
now allows rolling back or restarting a transaction (!65) -
ParseError
now implementsstd::error::Error
(!71) -
Added many more tests and documention:
TpToken
is now its own type instead of au64
, to prevent passing in an invalid tptoken (!76).tp_st
now takes a slice of strings instead of a slice ofVec
(!64)bindgen
is now built in debug mode even when YDBRust is built in release mode, greatly improving compile times (!81)- The buffers in the
context_api
are no longer pre-allocated, greatly reducing memory usage (!82) bindgen
has been updated to0.54
(!91)
-
Many crashes, panics, and segfaults have been fixed. See variously
-
incr_st
no longer increments twice when passed anout_buffer
that is too small (!44)
- Removed
impl DerefMut<Target = Vec<u8>> for Key
in favor of more specific methods and impls
- The
add_st()
,set_st()
, anddelete_st()
functions now take&Key
instead of&mut Key
, making the borrow semantics easier to work with. See #12 for more details. - Updated bindgen to 0.52, removing several unnecessary dependencies
KeyContext::get_and_parse()
convenience function
- Use
truncate()
orresize()
instead ofset_len()
in documentation and examples