pub struct AssetReference { /* private fields */ }Implementations§
Source§impl AssetReference
impl AssetReference
Sourcepub fn new<T>(location: T) -> AssetReference
pub fn new<T>(location: T) -> AssetReference
Create a new location reference.
Sourcepub const fn with_options(
&self,
options: OciOptions,
) -> FetchableAssetReference<'_>
pub const fn with_options( &self, options: OciOptions, ) -> FetchableAssetReference<'_>
Embed OciOptions with an AssetReference.
Sourcepub fn get_relative_part(&self) -> Result<PathBuf, Error>
pub fn get_relative_part(&self) -> Result<PathBuf, Error>
Get the relative part of the path or return an error if the path does not exist within the base URL.
pub fn baseurl(&self) -> Option<PathBuf>
pub fn path(&self) -> Result<PathBuf, Error>
pub fn location(&self) -> &str
pub fn is_directory(&self) -> bool
pub async fn bytes(&self, options: &OciOptions) -> Result<Bytes, Error>
Sourcepub fn exists_outside_cache(&self) -> bool
pub fn exists_outside_cache(&self) -> bool
Check if the asset exists on disk and isn’t in the cache.
Trait Implementations§
Source§impl Asset for AssetReference
impl Asset for AssetReference
type Options = OciOptions
fn update_baseurl(&self, baseurl: &Path)
fn fetch_with_progress( &self, _options: OciOptions, ) -> Pin<Box<dyn Stream<Item = Progress> + Send + '_>>
fn fetch( &self, options: OciOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Sync + Send>>
fn name(&self) -> &str
Source§impl AssetManager for AssetReference
impl AssetManager for AssetReference
type Asset = AssetReference
fn set_baseurl(&self, baseurl: &Path)
fn assets(&self) -> Assets<'_, <AssetReference as AssetManager>::Asset>
fn get_asset_flags(&self) -> u32
Source§impl Clone for AssetReference
impl Clone for AssetReference
Source§fn clone(&self) -> AssetReference
fn clone(&self) -> AssetReference
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AssetReference
impl Debug for AssetReference
Source§impl Display for AssetReference
impl Display for AssetReference
Source§impl From<&Path> for AssetReference
impl From<&Path> for AssetReference
Source§fn from(s: &Path) -> AssetReference
fn from(s: &Path) -> AssetReference
Converts to this type from the input type.
Source§impl From<&PathBuf> for AssetReference
impl From<&PathBuf> for AssetReference
Source§fn from(s: &PathBuf) -> AssetReference
fn from(s: &PathBuf) -> AssetReference
Converts to this type from the input type.
Source§impl From<&String> for AssetReference
impl From<&String> for AssetReference
Source§fn from(s: &String) -> AssetReference
fn from(s: &String) -> AssetReference
Converts to this type from the input type.
Source§impl From<&str> for AssetReference
impl From<&str> for AssetReference
Source§fn from(s: &str) -> AssetReference
fn from(s: &str) -> AssetReference
Converts to this type from the input type.
Source§impl<'a> From<AssetRef<'a, AssetReference>> for AssetReference
impl<'a> From<AssetRef<'a, AssetReference>> for AssetReference
Source§fn from(asset_ref: AssetRef<'a, AssetReference>) -> AssetReference
fn from(asset_ref: AssetRef<'a, AssetReference>) -> AssetReference
Converts to this type from the input type.
Source§impl FromStr for AssetReference
impl FromStr for AssetReference
Source§impl Hash for AssetReference
impl Hash for AssetReference
Source§impl PartialEq for AssetReference
impl PartialEq for AssetReference
Source§impl Serialize for AssetReference
impl Serialize for AssetReference
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl TryFrom<AssetReference> for LocationReference
impl TryFrom<AssetReference> for LocationReference
Source§type Error = ManifestError
type Error = ManifestError
The type returned in the event of a conversion error.
Source§impl TryFrom<LocationReference> for AssetReference
impl TryFrom<LocationReference> for AssetReference
Source§type Error = ManifestError
type Error = ManifestError
The type returned in the event of a conversion error.
Source§impl TryFrom<String> for AssetReference
impl TryFrom<String> for AssetReference
impl Eq for AssetReference
Auto Trait Implementations§
impl Freeze for AssetReference
impl !RefUnwindSafe for AssetReference
impl Send for AssetReference
impl Sync for AssetReference
impl Unpin for AssetReference
impl !UnwindSafe for AssetReference
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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