Trait scroll::TryOffsetWith
[−]
[src]
pub trait TryOffsetWith<Ctx = DefaultCtx, E = Error, I = usize> { fn try_offset<N: SizeWith<Ctx, Units = I>>(
&self,
offset: I,
ctx: &Ctx
) -> Result<I, E>; }
Attempt to add an offset for a given N
's size, used to compute error values in Gread
, or return the N
's size in units the same as the offset
NB: this trait's name is likely to be changed, tweaked slightly, if you are implementing an entire Pread
stack, beware this could change
Required Methods
fn try_offset<N: SizeWith<Ctx, Units = I>>(
&self,
offset: I,
ctx: &Ctx
) -> Result<I, E>
&self,
offset: I,
ctx: &Ctx
) -> Result<I, E>
Given the offset
, see if a size + offset can safely be performed on Self
, and return the resulting computed size