pub struct RemoteSession { /* private fields */ }Expand description
The remote reads of one request: each URL probed once, one block cache, one cancel.
Sessions share nothing, so a request reads only bytes its own URLs were answered with.
Implementations§
Source§impl RemoteSession
impl RemoteSession
Sourcepub fn new(
transport: Arc<dyn RangeTransport>,
cancel: CancelToken,
cache_bytes: u64,
) -> Self
pub fn new( transport: Arc<dyn RangeTransport>, cancel: CancelToken, cache_bytes: u64, ) -> Self
A session reading through transport, holding at most cache_bytes of blocks (at least
one per reader), stopped by cancel.
Sourcepub fn open(&self, url: &str) -> Result<Arc<RemoteObject>, RemoteError>
pub fn open(&self, url: &str) -> Result<Arc<RemoteObject>, RemoteError>
The object at url, probed on its first open in this session: a GET of the first block
that must answer 206 with a numeric total, an identity body and a validator.
§Errors
The probe’s failure: RemoteFailure::Offline for 404 and 410,
RemoteFailure::Empty for an empty object, or the code the failure maps to.
Sourcepub fn counts(&self) -> RemoteCounts
pub fn counts(&self) -> RemoteCounts
What the session’s reads cost so far.
Sourcepub fn cached_bytes(&self) -> u64
pub fn cached_bytes(&self) -> u64
The bytes the block cache holds now.
Auto Trait Implementations§
impl !Freeze for RemoteSession
impl !RefUnwindSafe for RemoteSession
impl !UnwindSafe for RemoteSession
impl Forget for RemoteSession
impl Move for RemoteSession
impl Send for RemoteSession
impl Sync for RemoteSession
impl Unpin for RemoteSession
impl UnsafeUnpin for RemoteSessionwhere
*const ArcInner<Shared> is !null: UnsafeUnpin,
PhantomData<ArcInner<Shared>>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<(String, Arc<RemoteObject>)>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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