pub struct RemoteWindow { /* private fields */ }Expand description
The bytes a snapshot actually covers: where the content starts, how many bytes it holds, and how large the whole file was when inspected. The buffer contains exactly the window — nothing more is implied.
Implementations§
Source§impl RemoteWindow
impl RemoteWindow
Sourcepub fn resolve(selection: &ReadSelection, file_size: RemoteSize) -> Self
pub fn resolve(selection: &ReadSelection, file_size: RemoteSize) -> Self
Resolve a selection against an inspected size. Every branch is clamped with checked arithmetic; an empty result is represented, not refused.
Sourcepub fn start(&self) -> RemoteOffset
pub fn start(&self) -> RemoteOffset
Where the covered bytes begin.
Sourcepub fn length(&self) -> RemoteSize
pub fn length(&self) -> RemoteSize
How many bytes the snapshot holds.
Sourcepub fn file_size(&self) -> RemoteSize
pub fn file_size(&self) -> RemoteSize
The whole-file size captured at inspection time.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
True only when the snapshot covers the entire inspected file.
Trait Implementations§
Source§impl Clone for RemoteWindow
impl Clone for RemoteWindow
Source§fn clone(&self) -> RemoteWindow
fn clone(&self) -> RemoteWindow
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for RemoteWindow
Source§impl Debug for RemoteWindow
impl Debug for RemoteWindow
Source§impl<'de> Deserialize<'de> for RemoteWindow
impl<'de> Deserialize<'de> for RemoteWindow
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
impl Eq for RemoteWindow
Source§impl Hash for RemoteWindow
impl Hash for RemoteWindow
Source§impl PartialEq for RemoteWindow
impl PartialEq for RemoteWindow
Source§impl Serialize for RemoteWindow
impl Serialize for RemoteWindow
impl StructuralPartialEq for RemoteWindow
Auto Trait Implementations§
impl Freeze for RemoteWindow
impl RefUnwindSafe for RemoteWindow
impl Send for RemoteWindow
impl Sync for RemoteWindow
impl Unpin for RemoteWindow
impl UnsafeUnpin for RemoteWindow
impl UnwindSafe for RemoteWindow
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