Created
January 22, 2017 21:40
-
-
Save Robbepop/b2198159bf5382236fbdaeed93ab6afa to your computer and use it in GitHub Desktop.
This file contains hidden or 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
use std::rc::Rc; | |
use std::cell::Cell; | |
use std::cell::RefCell; | |
use std::ops::Add; | |
use std::ops::Sub; | |
use std::ops::Range; | |
use std::fmt; | |
use std::io; | |
use std::path::Path; // used by the FileLoader trait | |
use std::ops::Deref; | |
pub trait RangeIndex: PartialOrd { | |
fn from_usize(value: usize) -> Self; | |
fn to_usize(&self) -> usize; | |
} | |
pub trait RangeFromTo<T> | |
where T: RangeIndex | |
{ | |
fn begin(&self) -> T; | |
fn end(&self) -> T; | |
} | |
pub trait IndexRangeSequence<T, I = usize> | |
where I: RangeIndex | |
T: Index<I> + Index<Range<I>> | |
{ | |
} | |
pub enum Err<I = usize> | |
where I: RangeIndex | |
{ | |
OutOfBoundsAccess{at: I}, | |
OverlappingAccess{from: I, to: I} | |
} | |
#[derive(Debug, Clone, PartialEq, Eq)] | |
pub struct<T, I> IndexRangeSequence | |
where T: Index<I> + Index<Range<I>> | |
I: RangeIndex | |
{ | |
elems: Vec<Sequence<T, I>> | |
} | |
#[derive(Debug, Clone, PartialEq, Eq)] | |
pub struct<T, I> Sequence | |
where T: Index<I> + Index<Range<I>> | |
I: RangeIndex | |
{ | |
idx : Range<I> | |
elem: T, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment