pub struct Reader;Expand description
A reader for chain files.
Implementations§
Source§impl Reader
impl Reader
Sourcepub fn from_bytes(data: &[u8]) -> Result<ChainMap>
pub fn from_bytes(data: &[u8]) -> Result<ChainMap>
Create a new reader from a byte slice.
§Arguments
data- A reference to a byte slice.
§Returns
A Result containing a FxHashMap of Chain objects.
§Example
use chaintools as chain;
let line = b"chain 4900 chrY 58368225 + 25985403 25985638 chr5 151006098 - 43257292 43257528 1\n9\t1\t0\n\n";
let data = chain::Reader::from_bytes(line)?;
assert_eq!(data.len(), 1);Sourcepub fn load_chain<T>(id: u32, bin: T) -> Result<Chain>
pub fn load_chain<T>(id: u32, bin: T) -> Result<Chain>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Reader
impl<'de> Deserialize<'de> for Reader
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Reader
impl RefUnwindSafe for Reader
impl Send for Reader
impl Sync for Reader
impl Unpin for Reader
impl UnwindSafe for Reader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more