aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2024-06-22 11:52:13 -0700
committeriximeow <me@iximeow.net>2024-06-22 11:52:13 -0700
commit872adb302b1c51cda7b1e99e128129e230e24ff8 (patch)
tree027852478066299e47a14a2045c020244b219b53
parent34b3cb568fb8aa2f326ab0ecd8384762aa14ed03 (diff)
update changelog, adjust doc emphasis
-rw-r--r--CHANGELOG30
-rw-r--r--src/reader.rs5
2 files changed, 31 insertions, 4 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 4fb39ab..3bc66ce 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,8 +1,34 @@
-## 0.3.0
+## TODO
-TODO: Reader::next_n should return the number of items read as Err(ReadError::Incomplete(n)) if the buffer is exhausted
+~~TODO: Reader::next_n should return the number of items read as Err(ReadError::Incomplete(n)) if the buffer is exhausted~~
+* a reader's `.offset()` should reflect the amount of items that were consumed, if any. if a reader can quickly determine
+ there is not enough input, should it return Incomplete(0) or ExhaustedInput? Incomplete(0) vs ExhaustedInput may still
+ imply that some state was changed (an access mode, for example). this needs more thought.
TODO: Reader::offset should return an AddressDiff<Address>, not a bare Address
+* quick look seems reasonable enough, should be changed in concert with
+ yaxpeax-core though and that's more than i'm signing up for today
TODO: impls of `fn one` and `fn zero` so downstream users don't have to import num_traits directly
+* seems nice at first but this means that there are conflicting functions when Zero or One are in scope
+ ... assuming that the idea at the time was to add `fn one` and `fn zero` to `AddressBase`.
+
+## 0.3.0
+
+added `yaxpeax_arch::display::DisplaySink` after revisiting output colorization.
+ `DisplaySink` is better suited for general markup, rather than being focused
+ specifically on ANSI/console text coloring. `YaxColors` also simply does not
+ style text in some unfortunate circumstances, such as when the console that
+ needs to be styled is only written to after intermediate buffering.
+
+`DisplaySink` also includes specializable functions for writing text to an
+output, and the implementation for `alloc::string::String` takes advantage of
+this: writing through `impl DisplaySink for String` will often be substantially
+more performant than writing through `fmt::Write`.
+
+added `yaxpeax_arch::safer_unchecked` to aid in testing use of unchecked methods
+ these were originally added to improve yaxpeax-x86 testing:
+ https://github.com/iximeow/yaxpeax-x86/pull/17, but are being pulled into
+ yaxpeax-arch as they're generally applicable and overall wonderful tools.
+ thank you again 522!
## 0.2.8
diff --git a/src/reader.rs b/src/reader.rs
index 028d835..8b68486 100644
--- a/src/reader.rs
+++ b/src/reader.rs
@@ -24,8 +24,9 @@ pub enum ReadError {
/// isn't a multiple of 8 bits, `U8Reader` won't be sufficient.
pub trait Reader<Address, Item> {
fn next(&mut self) -> Result<Item, ReadError>;
- /// read `buf`-many items from this reader in bulk. if `Reader` cannot read `buf`-many items,
- /// return `ReadError::ExhaustedInput`.
+ /// read `buf`-many items from this reader in bulk.
+ ///
+ /// if `Reader` cannot read `buf`-many items, return `ReadError::ExhaustedInput`.
fn next_n(&mut self, buf: &mut [Item]) -> Result<(), ReadError>;
/// mark the current position as where to measure `offset` against.
fn mark(&mut self);