[−][src]Struct cannyls::device::DeviceHandle
デバイスを操作するためのハンドル.
Methods
impl DeviceHandle[src]
pub fn request(&self) -> DeviceRequest[src]
デバイスの発行するリクエストのビルダを返す.
pub fn metrics(&self) -> &Arc<DeviceMetrics>[src]
デバイスのメトリクスを返す.
pub fn allocate_lump_data(&self, size: usize) -> Result<LumpData>[src]
ストレージのブロック境界にアライメントされたメモリ領域を保持するLumpDataインスタンスを返す.
LumpData::new関数に比べて、このメソッドが返したLumpDataインスタンスは、
デバイスが管理しているストレージのブロック境界に合わせたアライメントが行われているため、
ストレージへのPUT時に余計なメモリコピーが発生することがなく、より効率的となる.
注意
このメソッドが返したLumpDataインスタンスを、別の(ブロックサイズが異なる)ストレージに
保存しようとした場合には、エラーが発生する.
Errors
指定されたサイズがMAX_SIZEを超えている場合は、ErrorKind::InvalidInputエラーが返される.
pub fn allocate_lump_data_with_bytes(&self, bytes: &[u8]) -> Result<LumpData>[src]
allocate_lump_dataメソッドにデータの初期化を加えたメソッド.
このメソッドの呼び出しは、以下のコードと等価となる:
ⓘThis example is not tested
let mut data = track!(self.allocate_lump_data(bytes.len()))?; data.as_bytes_mut().copy_from_slice(bytes);
詳細な挙動に関してはallocate_lump_dataのドキュメントを参照のこと.
Trait Implementations
impl Clone for DeviceHandle[src]
fn clone(&self) -> DeviceHandle[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for DeviceHandle[src]
Auto Trait Implementations
impl !RefUnwindSafe for DeviceHandle
impl Send for DeviceHandle
impl !Sync for DeviceHandle
impl Unpin for DeviceHandle
impl !UnwindSafe for DeviceHandle
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,