pub struct HTTPStore { /* private fields */ }Expand description
A synchronous HTTP store.
Implementations§
Source§impl HTTPStore
impl HTTPStore
Sourcepub fn new(base_url: &str) -> Result<Self, HTTPStoreCreateError>
pub fn new(base_url: &str) -> Result<Self, HTTPStoreCreateError>
Create a new HTTP store at a given base_url.
§Errors
Returns a HTTPStoreCreateError if base_url is not a valid URL.
Sourcepub fn set_batch_range_requests(&mut self, batch_range_requests: bool)
pub fn set_batch_range_requests(&mut self, batch_range_requests: bool)
Set whether to batch range requests.
Defaults to true. Some servers do not fully support multipart ranges and might return an entire resource given such a request. It may be preferable to disable batched range requests in this case, so that each range request is a single part range.
Sourcepub fn key_to_url(&self, key: &StoreKey) -> Result<Url, ParseError>
pub fn key_to_url(&self, key: &StoreKey) -> Result<Url, ParseError>
Trait Implementations§
Source§impl ReadableStorageTraits for HTTPStore
impl ReadableStorageTraits for HTTPStore
Source§fn get(&self, key: &StoreKey) -> Result<MaybeBytes, StorageError>
fn get(&self, key: &StoreKey) -> Result<MaybeBytes, StorageError>
Source§fn get_partial_many<'a>(
&'a self,
key: &StoreKey,
byte_ranges: ByteRangeIterator<'a>,
) -> Result<MaybeBytesIterator<'a>, StorageError>
fn get_partial_many<'a>( &'a self, key: &StoreKey, byte_ranges: ByteRangeIterator<'a>, ) -> Result<MaybeBytesIterator<'a>, StorageError>
Retrieve partial bytes from a list of byte ranges for a store key. Read more
Source§fn size_key(&self, key: &StoreKey) -> Result<Option<u64>, StorageError>
fn size_key(&self, key: &StoreKey) -> Result<Option<u64>, StorageError>
Return the size in bytes of the value at
key. Read moreSource§fn supports_get_partial(&self) -> bool
fn supports_get_partial(&self) -> bool
Returns whether this store supports partial reads. Read more
Source§fn get_partial(
&self,
key: &StoreKey,
byte_range: ByteRange,
) -> Result<Option<Bytes>, StorageError>
fn get_partial( &self, key: &StoreKey, byte_range: ByteRange, ) -> Result<Option<Bytes>, StorageError>
Retrieve partial bytes from a single byte range for a store key. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for HTTPStore
impl !UnwindSafe for HTTPStore
impl Freeze for HTTPStore
impl Send for HTTPStore
impl Sync for HTTPStore
impl Unpin for HTTPStore
impl UnsafeUnpin for HTTPStore
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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