Struct sdl2::rwops::RWops [] [src]

pub struct RWops<'a> {
    // some fields omitted
}

A structure that provides an abstract interface to stream I/O.

Methods

impl<'a> RWops<'a>

unsafe fn raw(&self) -> *mut SDL_RWops

unsafe fn from_ll<'b>(raw: *mut SDL_RWops) -> RWops<'b>

fn from_file<P: AsRef<Path>>(path: P, mode: &str) -> SdlResult<RWops<'static>>

Creates an SDL file stream.

fn from_bytes(buf: &'a [u8]) -> SdlResult<RWops<'a>>

Prepares a read-only memory buffer for use with RWops.

This method can only fail if the buffer size is zero.

fn from_bytes_mut(buf: &'a mut [u8]) -> SdlResult<RWops<'a>>

Prepares a read-write memory buffer for use with RWops.

This method can only fail if the buffer size is zero.

fn len(&self) -> Option<usize>

Gets the stream's total size in bytes.

Returns None if the stream size can't be determined (either because it doesn't make sense for the stream type, or there was an error).

Trait Implementations

impl<'a> Drop for RWops<'a>

fn drop(&mut self)

impl<'a> Read for RWops<'a>

fn read(&mut self, buf: &mut [u8]) -> Result<usize>

fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>

fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>

fn by_ref(&mut self) -> &mut Self

fn bytes(self) -> Bytes<Self>

fn chars(self) -> Chars<Self>

fn chain<R>(self, next: R) -> Chain<Self, R> where R: Read

fn take(self, limit: u64) -> Take<Self>

fn tee<W>(self, out: W) -> Tee<Self, W> where W: Write

impl<'a> Write for RWops<'a>

fn write(&mut self, buf: &[u8]) -> Result<usize>

fn flush(&mut self) -> Result<()>

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>

fn by_ref(&mut self) -> &mut Self

fn broadcast<W>(self, other: W) -> Broadcast<Self, W> where W: Write

impl<'a> Seek for RWops<'a>

fn seek(&mut self, pos: SeekFrom) -> Result<u64>