pub struct SBFile {
pub raw: SBFileRef,
}
Expand description
Represents a file.
Fields
raw: SBFileRef
The underlying raw SBFileRef
.
Implementations
sourceimpl SBFile
impl SBFile
sourcepub fn from_fd(&self, fd: i32, mode: &str, transfer_ownership: bool) -> SBFile
pub fn from_fd(&self, fd: i32, mode: &str, transfer_ownership: bool) -> SBFile
Create an SBFile
from a file descriptor.
sourcepub fn read(&self, buf: &mut [u8]) -> Result<usize, SBError>
pub fn read(&self, buf: &mut [u8]) -> Result<usize, SBError>
Read data from the file.
If successful, the result will contain the number of bytes read.
Auto Trait Implementations
impl RefUnwindSafe for SBFile
impl !Send for SBFile
impl !Sync for SBFile
impl Unpin for SBFile
impl UnwindSafe for SBFile
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more