pub struct SBFile {
pub raw: SBFileRef,
}
Expand description
Represents a file.
Fields§
§raw: SBFileRef
The underlying raw SBFileRef
.
Implementations§
Source§impl 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 Freeze for SBFile
impl RefUnwindSafe for SBFile
impl !Send for SBFile
impl !Sync for SBFile
impl Unpin for SBFile
impl UnwindSafe for SBFile
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