pub struct ByteStore {
pub buf: Rc<RefCell<Vec<u8>>>,
pub off: usize,
pub len: usize,
pub kind: u8,
}Expand description
オブジェクトの種別。Plain 以外は内部表現を持つ。
1 バイト型 TypedArray の記憶域(共有のバイト列のうち off から len バイト)。
Fields§
§buf: Rc<RefCell<Vec<u8>>>§off: usize§len: usize§kind: u80 = Uint8、1 = Int8、2 = Uint8Clamped。
Implementations§
Source§impl ByteStore
impl ByteStore
pub fn new(bytes: Vec<u8>, kind: u8) -> Self
Sourcepub fn view(&self, start: usize, len: usize, kind: u8) -> Self
pub fn view(&self, start: usize, len: usize, kind: u8) -> Self
同じ記憶域の [start, start+len) を指す(subarray)。
pub fn get(&self, i: usize) -> Option<f64>
Sourcepub fn set(&self, i: usize, v: f64)
pub fn set(&self, i: usize, v: f64)
要素型に合わせて変換して書く(Uint8: ToUint8、Int8: ToInt8、Clamped: 丸めて 0..255)。
pub fn coerce(v: f64, kind: u8) -> u8
pub fn to_vec(&self) -> Vec<u8> ⓘ
pub fn values(&self) -> Vec<Value>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ByteStore
impl !Send for ByteStore
impl !Sync for ByteStore
impl !UnwindSafe for ByteStore
impl Freeze for ByteStore
impl Unpin for ByteStore
impl UnsafeUnpin for ByteStore
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