Better separation between puiblic/private types in exported API #43

Merged
bazaah merged 5 commits from feature/event/hide-scalar-internals into master 2022-03-27 10:51:02 +00:00

5 Commits

Author SHA1 Message Date
Paul Stemmet f946599735
event/types: hide internal types
This commit modifies the former Scalar (now know as ScalarLike) enum to
hide the internal types inside local opaque wrappers. Rather than the
previous struct variants, ScalarLike now takes Eager(Scalar) and
Lazy(ScalarLazy) variants, both of which hide internal types involved.

This commit also removes the ScanResult return types from public view,
converting them to the library level Error type.
2022-03-27 10:47:17 +00:00
Paul Stemmet 1f1cc428c5
scanner/error: add From impl for ScanError to public Error 2022-03-27 10:47:17 +00:00
Paul Stemmet 441b4ea8ae
lib/scanner: make most types crate private 2022-03-27 10:47:17 +00:00
Paul Stemmet 72cc42b9f3
lib/reader: hide private types in Read methods
We place a small wrapper around all of the arguments provided to
Read::drive(), and return a wrapped error, both of which are opaque to
external libraries.
2022-03-27 10:47:17 +00:00
Paul Stemmet 7b9d837812
lib: move Slice, ScalarStyle, StreamEncoding enums
from lib/token to event/types, and add Copy derives for ScalarStyle +
StreamEncoding.
2022-03-27 10:46:52 +00:00