pub struct PlatformFile { /* private fields */ }Implementations§
Source§impl PlatformFile
impl PlatformFile
pub fn from_path( name: impl Into<String>, path: impl Into<PathBuf>, ) -> PlatformFile
pub fn name(&self) -> &str
pub fn extension(&self) -> Option<&str>
pub fn mime_type(&self) -> Option<String>
pub fn source(&self) -> &FileSource
pub fn path(&self) -> Option<&Path>
pub fn uri(&self) -> Option<&str>
pub fn data(&self) -> Option<&Bytes>
pub fn size(&self) -> Option<u64>
pub fn read_bytes(&self) -> Result<Bytes, RlobKitError>
pub async fn read_bytes_async(&self) -> Result<Bytes, RlobKitError>
pub fn write_bytes(&self, data: &[u8]) -> Result<(), RlobKitError>
pub fn write_string(&self, s: &str) -> Result<(), RlobKitError>
pub fn builder(name: impl Into<String>) -> PlatformFileBuilder
Trait Implementations§
Source§impl Clone for PlatformFile
impl Clone for PlatformFile
Source§fn clone(&self) -> PlatformFile
fn clone(&self) -> PlatformFile
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 moreSource§impl Debug for PlatformFile
impl Debug for PlatformFile
impl Eq for PlatformFile
Source§impl PartialEq for PlatformFile
impl PartialEq for PlatformFile
impl StructuralPartialEq for PlatformFile
Auto Trait Implementations§
impl !Freeze for PlatformFile
impl RefUnwindSafe for PlatformFile
impl Send for PlatformFile
impl Sync for PlatformFile
impl Unpin for PlatformFile
impl UnsafeUnpin for PlatformFile
impl UnwindSafe for PlatformFile
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.