Struct SeekableAsyncFile

Source
pub struct SeekableAsyncFile { /* private fields */ }
Expand description

A File-like value that can perform async read_at and write_at for I/O at specific offsets without mutating any state (i.e. is thread safe). Metrics are collected, and syncs can be delayed for write batching opportunities as a performance optimisation.

Implementations§

Source§

impl SeekableAsyncFile

Source

pub async fn open( path: &Path, size: u64, metrics: Arc<SeekableAsyncFileMetrics>, sync_delay: Duration, flags: i32, ) -> Self

Open a file descriptor in read and write modes, creating it if it doesn’t exist. If it already exists, the contents won’t be truncated.

If the mmap feature is being used, to save a stat call, the size must be provided. This also allows opening non-standard files which may have a size of zero (e.g. block devices). A different size value also allows only using a portion of the beginning of the file.

The io_direct and io_dsync parameters set the O_DIRECT and O_DSYNC flags, respectively. Unless you need those flags, provide false.

Make sure to execute start_delayed_data_sync_background_loop in the background after this call.

Source

pub unsafe fn get_mmap_raw_ptr(&self, offset: u64) -> *const u8

Source

pub unsafe fn get_mmap_raw_mut_ptr(&self, offset: u64) -> *mut u8

Source

pub async fn read_at(&self, offset: u64, len: u64) -> Vec<u8>

Source

pub fn read_at_sync(&self, offset: u64, len: u64) -> Vec<u8>

Source

pub async fn write_at<D: AsRef<[u8]> + Send + 'static>( &self, offset: u64, data: D, )

Source

pub fn write_at_sync<D: AsRef<[u8]> + Send + 'static>( &self, offset: u64, data: D, )

Source

pub async fn write_at_with_delayed_sync<D: AsRef<[u8]> + Send + 'static>( &self, writes: impl IntoIterator<Item = WriteRequest<D>>, )

Source

pub async fn start_delayed_data_sync_background_loop(&self)

Source

pub async fn sync_data(&self)

Trait Implementations§

Source§

impl Clone for SeekableAsyncFile

Source§

fn clone(&self) -> SeekableAsyncFile

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Off64AsyncRead<'a, Vec<u8>> for SeekableAsyncFile

Source§

fn read_at<'life0, 'async_trait>( &'life0 self, offset: u64, len: u64, ) -> Pin<Box<dyn Future<Output = Vec<u8>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

impl<'a> Off64AsyncReadChrono<'a, Vec<u8>> for SeekableAsyncFile

Source§

fn read_timestamp_be_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = DateTime<Utc>> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_timestamp_millis_be_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = DateTime<Utc>> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_timestamp_le_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = DateTime<Utc>> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_timestamp_millis_le_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = DateTime<Utc>> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

impl<'a> Off64AsyncReadInt<'a, Vec<u8>> for SeekableAsyncFile

Source§

fn read_i16_be_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = i16> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_i16_le_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = i16> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_u16_be_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = u16> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_u16_le_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = u16> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_i24_be_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = i32> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_i24_le_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = i32> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_u24_be_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = u32> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_u24_le_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = u32> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_i32_be_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = i32> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_i32_le_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = i32> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_u32_be_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = u32> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_u32_le_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = u32> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_i40_be_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = i64> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_i40_le_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = i64> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_u40_be_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_u40_le_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_i48_be_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = i64> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_i48_le_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = i64> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_u48_be_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_u48_le_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_i56_be_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = i64> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_i56_le_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = i64> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_u56_be_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_u56_le_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_i64_be_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = i64> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_i64_le_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = i64> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_u64_be_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

fn read_u64_le_at<'async_trait>( &'a self, offset: u64, ) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Source§

impl Off64AsyncWrite for SeekableAsyncFile

Source§

fn write_at<'life0, 'life1, 'async_trait>( &'life0 self, offset: u64, value: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

impl Off64AsyncWriteChrono for SeekableAsyncFile

Source§

fn write_timestamp_be_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_timestamp_millis_be_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_timestamp_le_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_timestamp_millis_le_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

impl Off64AsyncWriteInt for SeekableAsyncFile

Source§

fn write_i16_be_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: i16, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_i16_le_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: i16, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_u16_be_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: u16, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_u16_le_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: u16, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_i24_be_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: i32, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_i24_le_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: i32, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_u24_be_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: u32, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_u24_le_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: u32, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_i32_be_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: i32, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_i32_le_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: i32, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_u32_be_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: u32, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_u32_le_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: u32, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_i40_be_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: i64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_i40_le_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: i64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_u40_be_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: u64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_u40_le_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: u64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_i48_be_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: i64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_i48_le_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: i64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_u48_be_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: u64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_u48_le_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: u64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_i56_be_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: i64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_i56_le_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: i64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_u56_be_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: u64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_u56_le_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: u64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_i64_be_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: i64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_i64_le_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: i64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_u64_be_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: u64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

fn write_u64_le_at<'life0, 'async_trait>( &'life0 self, offset: u64, value: u64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Source§

impl<'a> Off64Read<'a, Vec<u8>> for SeekableAsyncFile

Source§

fn read_at(&'a self, offset: u64, len: u64) -> Vec<u8>

Source§

impl<'a> Off64ReadChrono<'a, Vec<u8>> for SeekableAsyncFile

Source§

impl<'a> Off64ReadInt<'a, Vec<u8>> for SeekableAsyncFile

Source§

fn read_i16_be_at(&'a self, offset: u64) -> i16

Source§

fn read_i16_le_at(&'a self, offset: u64) -> i16

Source§

fn read_u16_be_at(&'a self, offset: u64) -> u16

Source§

fn read_u16_le_at(&'a self, offset: u64) -> u16

Source§

fn read_i24_be_at(&'a self, offset: u64) -> i32

Source§

fn read_i24_le_at(&'a self, offset: u64) -> i32

Source§

fn read_u24_be_at(&'a self, offset: u64) -> u32

Source§

fn read_u24_le_at(&'a self, offset: u64) -> u32

Source§

fn read_i32_be_at(&'a self, offset: u64) -> i32

Source§

fn read_i32_le_at(&'a self, offset: u64) -> i32

Source§

fn read_u32_be_at(&'a self, offset: u64) -> u32

Source§

fn read_u32_le_at(&'a self, offset: u64) -> u32

Source§

fn read_i40_be_at(&'a self, offset: u64) -> i64

Source§

fn read_i40_le_at(&'a self, offset: u64) -> i64

Source§

fn read_u40_be_at(&'a self, offset: u64) -> u64

Source§

fn read_u40_le_at(&'a self, offset: u64) -> u64

Source§

fn read_i48_be_at(&'a self, offset: u64) -> i64

Source§

fn read_i48_le_at(&'a self, offset: u64) -> i64

Source§

fn read_u48_be_at(&'a self, offset: u64) -> u64

Source§

fn read_u48_le_at(&'a self, offset: u64) -> u64

Source§

fn read_i56_be_at(&'a self, offset: u64) -> i64

Source§

fn read_i56_le_at(&'a self, offset: u64) -> i64

Source§

fn read_u56_be_at(&'a self, offset: u64) -> u64

Source§

fn read_u56_le_at(&'a self, offset: u64) -> u64

Source§

fn read_i64_be_at(&'a self, offset: u64) -> i64

Source§

fn read_i64_le_at(&'a self, offset: u64) -> i64

Source§

fn read_u64_be_at(&'a self, offset: u64) -> u64

Source§

fn read_u64_le_at(&'a self, offset: u64) -> u64

Source§

impl Off64Write for SeekableAsyncFile

Source§

fn write_at(&self, offset: u64, value: &[u8])

Source§

impl Off64WriteChrono for SeekableAsyncFile

Source§

fn write_timestamp_be_at(&self, offset: u64, value: DateTime<Utc>)

Source§

fn write_timestamp_millis_be_at(&self, offset: u64, value: DateTime<Utc>)

Source§

fn write_timestamp_le_at(&self, offset: u64, value: DateTime<Utc>)

Source§

fn write_timestamp_millis_le_at(&self, offset: u64, value: DateTime<Utc>)

Source§

impl Off64WriteInt for SeekableAsyncFile

Source§

fn write_i16_be_at(&self, offset: u64, value: i16)

Source§

fn write_i16_le_at(&self, offset: u64, value: i16)

Source§

fn write_u16_be_at(&self, offset: u64, value: u16)

Source§

fn write_u16_le_at(&self, offset: u64, value: u16)

Source§

fn write_i24_be_at(&self, offset: u64, value: i32)

Source§

fn write_i24_le_at(&self, offset: u64, value: i32)

Source§

fn write_u24_be_at(&self, offset: u64, value: u32)

Source§

fn write_u24_le_at(&self, offset: u64, value: u32)

Source§

fn write_i32_be_at(&self, offset: u64, value: i32)

Source§

fn write_i32_le_at(&self, offset: u64, value: i32)

Source§

fn write_u32_be_at(&self, offset: u64, value: u32)

Source§

fn write_u32_le_at(&self, offset: u64, value: u32)

Source§

fn write_i40_be_at(&self, offset: u64, value: i64)

Source§

fn write_i40_le_at(&self, offset: u64, value: i64)

Source§

fn write_u40_be_at(&self, offset: u64, value: u64)

Source§

fn write_u40_le_at(&self, offset: u64, value: u64)

Source§

fn write_i48_be_at(&self, offset: u64, value: i64)

Source§

fn write_i48_le_at(&self, offset: u64, value: i64)

Source§

fn write_u48_be_at(&self, offset: u64, value: u64)

Source§

fn write_u48_le_at(&self, offset: u64, value: u64)

Source§

fn write_i56_be_at(&self, offset: u64, value: i64)

Source§

fn write_i56_le_at(&self, offset: u64, value: i64)

Source§

fn write_u56_be_at(&self, offset: u64, value: u64)

Source§

fn write_u56_le_at(&self, offset: u64, value: u64)

Source§

fn write_i64_be_at(&self, offset: u64, value: i64)

Source§

fn write_i64_le_at(&self, offset: u64, value: i64)

Source§

fn write_u64_be_at(&self, offset: u64, value: u64)

Source§

fn write_u64_le_at(&self, offset: u64, value: u64)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.