Type byte_buf

type byte_buf = {buf: ~[const u8], mut pos: uint, len: uint,}

Type fd_t

type fd_t = c_int

Type mem_buffer

type mem_buffer = @{buf: dvec<u8>, mut pos: uint,}

Enum fileflag

Variants

Enum seek_style

Variants

Interface reader

Method read_bytes

fn read_bytes(uint) -> ~[u8]

Method read_byte

fn read_byte() -> int

Method unread_byte

fn unread_byte(int)

Method eof

fn eof() -> bool

Method seek

fn seek(int, seek_style)

Method tell

fn tell() -> uint

Interface writer

Method write

fn write(v: & [const u8])

Method seek

fn seek(int, seek_style)

Method tell

fn tell() -> uint

Method flush

fn flush() -> int

Implementation extensions of iter::base_iter<A> for IMPL_T<A>

Method each

fn each(blk: fn(A) -> bool)

Method size_hint

fn size_hint() -> option<uint>

Method eachi

fn eachi(blk: fn(uint, A) -> bool)

Method all

fn all(blk: fn(A) -> bool) -> bool

Method any

fn any(blk: fn(A) -> bool) -> bool

Method foldl

fn foldl<B>(+b0: B, blk: fn(B, A) -> B) -> B

Method contains

fn contains(x: A) -> bool

Method count

fn count(x: A) -> uint

Method position

fn position(f: fn(A) -> bool) -> option<uint>

Implementation extensions for IMPL_T<A>

Method filter_to_vec

fn filter_to_vec(pred: fn(A) -> bool) -> ~[A]

Method map_to_vec

fn map_to_vec<B>(op: fn(A) -> B) -> ~[B]

Method to_vec

fn to_vec() -> ~[A]

Method min

fn min() -> A

Method max

fn max() -> A

Method find

fn find(p: fn(A) -> bool) -> option<A>

Implementation extensions for *T

Extension methods for pointers

Method is_null

pure fn is_null() -> bool

Returns true if the pointer is equal to the null pointer.

Method is_not_null

pure fn is_not_null() -> bool

Returns true if the pointer is not equal to the null pointer.

Implementation extensions for dvec<A>

Method swap

fn swap(f: fn(-~[mut A]) -> ~[mut A])

Swaps out the current vector and hands it off to a user-provided function f. The function should transform it however is desired and return a new vector to replace it with.

Method len

fn len() -> uint

Returns the number of elements currently in the dvec

Method set

fn set(+w: ~[mut A])

Overwrite the current contents

Method pop

fn pop() -> A

Remove and return the last element

Method unshift

fn unshift(-t: A)

Insert a single item at the front of the list

Method push

fn push(+t: A)

Append a single item to the end of the list

Method shift

fn shift() -> A

Remove and return the first element

Implementation extensions for dvec<A>

Method push_all

fn push_all(ts: & [const A])

Append all elements of a vector to the end of the list

Equivalent to append_iter() but potentially more efficient.

Method push_slice

fn push_slice(ts: & [const A], from_idx: uint, to_idx: uint)

Appends elements from from_idx to to_idx (exclusive)

Method get

fn get() -> ~[A]

Gets a copy of the current contents.

See unwrap() if you do not wish to copy the contents.

Method []

fn [](idx: uint) -> A

Copy out an individual element

Method get_elt

fn get_elt(idx: uint) -> A

Copy out an individual element

Method set_elt

fn set_elt(idx: uint, a: A)

Overwrites the contents of the element at idx with a

Method grow_set_elt

fn grow_set_elt(idx: uint, initval: A, val: A)

Overwrites the contents of the element at idx with a, growing the vector if necessary. New elements will be initialized with initval

Method last

fn last() -> A

Returns the last element, failing if the vector is empty

Method reach

fn reach(f: fn(A) -> bool)

Iterates over the elements in reverse order

Implementation reader of reader for *libc::FILE

Method read_bytes

fn read_bytes(len: uint) -> ~[u8]

Method read_byte

fn read_byte() -> int

Method unread_byte

fn unread_byte(byte: int)

Method eof

fn eof() -> bool

Method seek

fn seek(offset: int, whence: seek_style)

Method tell

fn tell() -> uint

Implementation reader of reader for {base: T, cleanup: C,}

Method read_bytes

fn read_bytes(len: uint) -> ~[u8]

Method read_byte

fn read_byte() -> int

Method unread_byte

fn unread_byte(byte: int)

Method eof

fn eof() -> bool

Method seek

fn seek(off: int, whence: seek_style)

Method tell

fn tell() -> uint

Implementation reader of reader for byte_buf

Method read_bytes

fn read_bytes(len: uint) -> ~[u8]

Method read_byte

fn read_byte() -> int

Method unread_byte

fn unread_byte(_byte: int)

Method eof

fn eof() -> bool

Method seek

fn seek(offset: int, whence: seek_style)

Method tell

fn tell() -> uint

Implementation reader_util for reader

Method read_chars

fn read_chars(n: uint) -> ~[char]

Method read_char

fn read_char() -> char

Method read_line

fn read_line() -> str

Method read_c_str

fn read_c_str() -> str

Method read_le_uint

fn read_le_uint(size: uint) -> uint

Method read_le_int

fn read_le_int(size: uint) -> int

Method read_be_uint

fn read_be_uint(size: uint) -> uint

Method read_whole_stream

fn read_whole_stream() -> ~[u8]

Method each_byte

fn each_byte(it: fn(int) -> bool)

Method each_char

fn each_char(it: fn(char) -> bool)

Method each_line

fn each_line(it: fn(str) -> bool)

Implementation writer of writer for {base: T, cleanup: C,}

Method write

fn write(bs: & [const u8])

Method seek

fn seek(off: int, style: seek_style)

Method tell

fn tell() -> uint

Method flush

fn flush() -> int

Implementation writer of writer for *libc::FILE

Method write

fn write(v: & [const u8])

Method seek

fn seek(offset: int, whence: seek_style)

Method tell

fn tell() -> uint

Method flush

fn flush() -> int

Implementation writer of writer for fd_t

Method write

fn write(v: & [const u8])

Method seek

fn seek(_offset: int, _whence: seek_style)

Method tell

fn tell() -> uint

Method flush

fn flush() -> int

Implementation writer of writer for mem_buffer

Method write

fn write(v: & [const u8])

Method seek

fn seek(offset: int, whence: seek_style)

Method tell

fn tell() -> uint

Method flush

fn flush() -> int

Implementation writer_util for writer

Method write_char

fn write_char(ch: char)

Method write_str

fn write_str(s: str/& )

Method write_line

fn write_line(s: str/& )

Method write_int

fn write_int(n: int)

Method write_uint

fn write_uint(n: uint)

Method write_le_uint

fn write_le_uint(n: uint, size: uint)

Method write_le_int

fn write_le_int(n: int, size: uint)

Method write_be_uint

fn write_be_uint(n: uint, size: uint)

Method write_be_int

fn write_be_int(n: int, size: uint)

Method write_be_u64

fn write_be_u64(n: u64)

Method write_be_u32

fn write_be_u32(n: u32)

Method write_be_u16

fn write_be_u16(n: u16)

Method write_be_i64

fn write_be_i64(n: i64)

Method write_be_i32

fn write_be_i32(n: i32)

Method write_be_i16

fn write_be_i16(n: i16)

Method write_le_u64

fn write_le_u64(n: u64)

Method write_le_u32

fn write_le_u32(n: u32)

Method write_le_u16

fn write_le_u16(n: u16)

Method write_le_i64

fn write_le_i64(n: i64)

Method write_le_i32

fn write_le_i32(n: i32)

Method write_le_i16

fn write_le_i16(n: i16)

Method write_u8

fn write_u8(n: u8)

Function FILE_reader

fn FILE_reader(f: *libc::FILE, cleanup: bool) -> reader

Function FILE_writer

fn FILE_writer(f: *libc::FILE, cleanup: bool) -> writer

Function buffered_file_writer

fn buffered_file_writer(path: str) -> result<writer, str>

Function bytes_reader

fn bytes_reader(bytes: ~[u8]) -> reader

Function bytes_reader_between

fn bytes_reader_between(bytes: ~[u8], start: uint, end: uint) -> reader

Function convert_whence

fn convert_whence(whence: seek_style) -> i32

Function fd_writer

fn fd_writer(fd: fd_t, cleanup: bool) -> writer

Function file_reader

fn file_reader(path: str) -> result<reader, str>

Function file_writer

fn file_writer(path: str, flags: ~[fileflag]) -> result<writer, str>

Function mem_buffer

fn mem_buffer() -> mem_buffer

Function mem_buffer_buf

fn mem_buffer_buf(b: mem_buffer) -> ~[u8]

Function mem_buffer_str

fn mem_buffer_str(b: mem_buffer) -> str

Function mem_buffer_writer

fn mem_buffer_writer(b: mem_buffer) -> writer

Function mk_file_writer

fn mk_file_writer(path: str, flags: ~[fileflag]) -> result<writer, str>

Function print

fn print(s: str)

Function println

fn println(s: str)

Function read_whole_file

fn read_whole_file(file: str) -> result<~[u8], str>

Function read_whole_file_str

fn read_whole_file_str(file: str) -> result<str, str>

Function seek_in_buf

fn seek_in_buf(offset: int, pos: uint, len: uint, whence: seek_style) -> uint

Function stderr

fn stderr() -> writer

Function stdin

fn stdin() -> reader

Function stdout

fn stdout() -> writer

Function str_reader

fn str_reader(s: str) -> reader

Function u64_from_be_bytes

fn u64_from_be_bytes(data: ~[u8], start: uint, size: uint) -> u64

Function u64_to_be_bytes

fn u64_to_be_bytes<T>(n: u64, size: uint, f: fn(v: & [u8]) -> T) -> T

Function u64_to_le_bytes

fn u64_to_le_bytes<T>(n: u64, size: uint, f: fn(v: & [u8]) -> T) -> T

Function with_buf_writer

fn with_buf_writer(f: fn(writer)) -> ~[u8]

Function with_bytes_reader

fn with_bytes_reader<t>(bytes: ~[u8], f: fn(reader) -> t) -> t

Function with_bytes_reader_between

fn with_bytes_reader_between<t>(bytes: ~[u8], start: uint, end: uint,
                                f: fn(reader) -> t) -> t

Function with_str_reader

fn with_str_reader<T>(s: str, f: fn(reader) -> T) -> T

Function with_str_writer

fn with_str_writer(f: fn(writer)) -> str