#![warn(missing_docs)]
#[macro_use]
pub mod macros;
pub mod async_skip;
pub mod error;
pub mod parse;
mod skip;
pub mod sync;
pub mod util;
use std::io;
use std::pin::Pin;
use std::task::{Context, Poll};
use derive_more::{Deref, DerefMut};
pub use error::{Error, Report, Result, ResultExt};
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]
pub struct InputSpan {
pub offset: u64,
pub len: u64,
}
pub trait Skip {
fn skip(&mut self, amount: u64) -> io::Result<()>;
fn stream_position(&mut self) -> io::Result<u64>;
fn stream_len(&mut self) -> io::Result<u64>;
}
pub trait AsyncSkip {
fn poll_skip(self: Pin<&mut Self>, cx: &mut Context<'_>, amount: u64) -> Poll<io::Result<()>>;
fn poll_stream_position(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<u64>>;
fn poll_stream_len(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<u64>>;
}
#[derive(Clone, Copy, Debug, Default, Deref, DerefMut)]
pub struct SeekSkipAdapter<T: ?Sized>(pub T);
pub use async_skip::AsyncSkipExt;