-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds LazyRawTextReader
support for structs
#619
Merged
Merged
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
e0a83d8
Top-level nulls, bools, ints
89f79aa
Consolidate impls of AsUtf8 w/helper fn
840be4d
Improved TextBufferView docs, removed DataSource
5db1ff0
Adds lazy text floats
07d4a70
Adds LazyRawTextReader support for comments
181e0a5
Adds LazyRawTextReader support for reading strings
357ca8f
clippy fixes
716ff34
Fix a couple of unit tests
e29fec5
Less ambitious float eq comparison
8f79a36
Adds LazyRawTextReader support for reading symbols
4cb9b2b
Adds more doc comments
54470d2
More doc comments
78014e7
Adds `LazyRawTextReader` support for reading lists
a6a3aa8
Adds `LazyRawTextReader` support for structs
4fc9078
More doc comments
37a2a50
Merge remote-tracking branch 'origin/main' into lazy-structs
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
pub mod annotations_iterator; | ||
pub mod lazy_raw_sequence; | ||
pub mod reader; | ||
pub mod sequence; | ||
pub mod r#struct; | ||
pub mod value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
use std::marker::PhantomData; | ||
|
||
use crate::lazy::binary::raw::annotations_iterator::RawBinaryAnnotationsIterator; | ||
use crate::lazy::binary::raw::r#struct::LazyRawBinaryStruct; | ||
use crate::lazy::binary::raw::reader::LazyRawBinaryReader; | ||
use crate::lazy::binary::raw::sequence::LazyRawBinarySequence; | ||
use crate::lazy::binary::raw::value::LazyRawBinaryValue; | ||
use crate::lazy::decoder::LazyDecoder; | ||
use crate::lazy::text::raw::r#struct::LazyRawTextStruct; | ||
use crate::lazy::text::raw::reader::LazyRawTextReader; | ||
use crate::lazy::text::raw::sequence::LazyRawTextSequence; | ||
use crate::lazy::text::value::LazyRawTextValue; | ||
use crate::{IonResult, RawSymbolTokenRef}; | ||
|
||
// These types derive trait implementations in order to allow types that containing them | ||
// to also derive trait implementations. | ||
|
||
/// The Ion 1.0 binary encoding. | ||
#[derive(Clone, Debug)] | ||
pub struct BinaryEncoding; | ||
|
||
/// The Ion 1.0 text encoding. | ||
#[derive(Clone, Debug)] | ||
pub struct TextEncoding; | ||
|
||
impl<'data> LazyDecoder<'data> for BinaryEncoding { | ||
type Reader = LazyRawBinaryReader<'data>; | ||
type Value = LazyRawBinaryValue<'data>; | ||
type Sequence = LazyRawBinarySequence<'data>; | ||
type Struct = LazyRawBinaryStruct<'data>; | ||
type AnnotationsIterator = RawBinaryAnnotationsIterator<'data>; | ||
} | ||
|
||
// === Placeholders === | ||
// The types below will need to be properly defined in order for the lazy text reader to be complete. | ||
// The exist to satisfy various trait definitions. | ||
|
||
#[derive(Debug, Clone)] | ||
pub struct ToDoTextAnnotationsIterator<'data> { | ||
spooky: &'data PhantomData<()>, | ||
} | ||
|
||
impl<'data> Iterator for ToDoTextAnnotationsIterator<'data> { | ||
type Item = IonResult<RawSymbolTokenRef<'data>>; | ||
|
||
fn next(&mut self) -> Option<Self::Item> { | ||
todo!() | ||
} | ||
} | ||
|
||
impl<'data> LazyDecoder<'data> for TextEncoding { | ||
type Reader = LazyRawTextReader<'data>; | ||
type Value = LazyRawTextValue<'data>; | ||
type Sequence = LazyRawTextSequence<'data>; | ||
type Struct = LazyRawTextStruct<'data>; | ||
type AnnotationsIterator = ToDoTextAnnotationsIterator<'data>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗺️ This file housed lots of
ToDo*
types that existed to satisfy theLazyDecoder
trait. This PR replaces them with actual implementations.