Enum chunky_bits::file::Location[][src]

pub enum Location {
    Http(HttpUrl),
    Local(PathBuf),
}

Variants

Http(HttpUrl)
Local(PathBuf)

Implementations

impl Location[src]

pub async fn read(&self) -> Result<Vec<u8>, LocationError>[src]

pub async fn write<T>(&self, bytes: T) -> Result<(), LocationError> where
    T: AsRef<[u8]> + Into<Vec<u8>>, 
[src]

pub async fn write_subfile<T>(
    &self,
    name: &str,
    bytes: T
) -> Result<Location, ShardError> where
    T: AsRef<[u8]> + Into<Vec<u8>>, 
[src]

pub async fn delete(&self) -> Result<(), LocationError>[src]

pub async fn read_with_context(
    &self,
    cx: &LocationContext
) -> Result<Vec<u8>, LocationError>
[src]

pub async fn reader_with_context(
    &self,
    cx: &LocationContext
) -> Result<impl AsyncRead + Send + Unpin, LocationError>
[src]

pub async fn write_with_context<T>(
    &self,
    cx: &LocationContext,
    bytes: T
) -> Result<(), LocationError> where
    T: AsRef<[u8]> + Into<Vec<u8>>, 
[src]

pub async fn write_from_reader_with_context(
    &self,
    cx: &LocationContext,
    reader: &mut impl AsyncRead + Unpin
) -> Result<u64, LocationError>
[src]

pub async fn write_subfile_with_context<T>(
    &self,
    cx: &LocationContext,
    name: &str,
    bytes: T
) -> Result<Location, ShardError> where
    T: AsRef<[u8]> + Into<Vec<u8>>, 
[src]

pub async fn delete_with_context(
    &self,
    cx: &LocationContext
) -> Result<(), LocationError>
[src]

pub fn default_context() -> LocationContext[src]

pub fn is_child_of(&self, other: &Location) -> bool[src]

pub fn is_parent_of(&self, other: &Location) -> bool[src]

Trait Implementations

impl Clone for Location[src]

impl Debug for Location[src]

impl<'de> Deserialize<'de> for Location[src]

impl Display for Location[src]

impl Eq for Location[src]

impl From<&'_ Path> for Location[src]

impl From<HttpUrl> for Location[src]

impl From<Location> for WeightedLocation[src]

impl From<PathBuf> for Location[src]

impl FromStr for Location[src]

type Err = LocationParseError

The associated error which can be returned from parsing.

impl Hash for Location[src]

impl Ord for Location[src]

impl PartialEq<Location> for Location[src]

impl PartialOrd<Location> for Location[src]

impl Serialize for Location[src]

impl ShardWriter for Location[src]

impl StructuralEq for Location[src]

impl StructuralPartialEq for Location[src]

impl TryFrom<&'_ str> for Location[src]

type Error = LocationParseError

The type returned in the event of a conversion error.

impl TryFrom<String> for Location[src]

type Error = LocationParseError

The type returned in the event of a conversion error.

impl TryFrom<Url> for Location[src]

type Error = LocationParseError

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,