pub struct EntityDiskService { /* private fields */ }Expand description
Entity Disk Service - manages per-entity virtual disks
Implementations§
Source§impl EntityDiskService
impl EntityDiskService
Sourcepub async fn new<P: AsRef<Path>>(root: P) -> Result<Self>
pub async fn new<P: AsRef<Path>>(root: P) -> Result<Self>
Create a new EntityDiskService with the given root directory
Sourcepub async fn write_file(
&self,
entity_id: &str,
disk_type: DiskType,
path: &str,
data: &[u8],
) -> Result<FileInfo>
pub async fn write_file( &self, entity_id: &str, disk_type: DiskType, path: &str, data: &[u8], ) -> Result<FileInfo>
Write a file to an entity’s virtual disk
Sourcepub async fn read_file(
&self,
entity_id: &str,
disk_type: DiskType,
path: &str,
) -> Result<Vec<u8>>
pub async fn read_file( &self, entity_id: &str, disk_type: DiskType, path: &str, ) -> Result<Vec<u8>>
Read a file from an entity’s virtual disk
Sourcepub async fn list_files(
&self,
entity_id: &str,
disk_type: DiskType,
path: &str,
) -> Result<Vec<FileInfo>>
pub async fn list_files( &self, entity_id: &str, disk_type: DiskType, path: &str, ) -> Result<Vec<FileInfo>>
List files in a directory within an entity’s virtual disk
Sourcepub async fn delete_file(
&self,
entity_id: &str,
disk_type: DiskType,
path: &str,
) -> Result<()>
pub async fn delete_file( &self, entity_id: &str, disk_type: DiskType, path: &str, ) -> Result<()>
Delete a file from an entity’s virtual disk
Sourcepub async fn get_stats(
&self,
entity_id: &str,
disk_type: DiskType,
) -> Result<DiskStats>
pub async fn get_stats( &self, entity_id: &str, disk_type: DiskType, ) -> Result<DiskStats>
Get storage statistics for an entity’s disk
Sourcepub async fn create_directory(
&self,
entity_id: &str,
disk_type: DiskType,
path: &str,
) -> Result<FileInfo>
pub async fn create_directory( &self, entity_id: &str, disk_type: DiskType, path: &str, ) -> Result<FileInfo>
Create a directory in an entity’s virtual disk
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for EntityDiskService
impl !RefUnwindSafe for EntityDiskService
impl Send for EntityDiskService
impl Sync for EntityDiskService
impl Unpin for EntityDiskService
impl !UnwindSafe for EntityDiskService
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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