# [−] [src] Struct serialization::Stream

    pub struct Stream { /* fields omitted */ }

Stream used for serialization of Bitcoin structures

## Methods

###

`impl Stream`

[src]

####

`pub fn new() -> Self`

[src]

New stream

####

`pub fn with_flags(flags: u32) -> Self`

[src]

Create stream with given flags,

####

`pub fn include_transaction_witness(&self) -> bool`

[src]

Are transactions written to this stream with witness data?

####
ⓘImportant traits for &'a mut R

### Important traits for &'a mut R

`impl<'a, R> Read for &'a mut R where
R: Read + ?Sized, impl<'a, W> Write for &'a mut W where
W: Write + ?Sized, impl<'a, I> Iterator for &'a mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;`

`pub fn append<T>(&mut self, t: &T) -> &mut Self where T: Serializable,`

[src]

Serializes the struct and appends it to the end of stream.

####
ⓘImportant traits for &'a mut R

### Important traits for &'a mut R

`impl<'a, R> Read for &'a mut R where
R: Read + ?Sized, impl<'a, W> Write for &'a mut W where
W: Write + ?Sized, impl<'a, I> Iterator for &'a mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;`

`pub fn append_slice(&mut self, bytes: &[u8]) -> &mut Self`

[src]

Appends raw bytes to the end of the stream.

####
ⓘImportant traits for &'a mut R

### Important traits for &'a mut R

`impl<'a, R> Read for &'a mut R where
R: Read + ?Sized, impl<'a, W> Write for &'a mut W where
W: Write + ?Sized, impl<'a, I> Iterator for &'a mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;`

`pub fn append_list<T, K>(&mut self, t: &[K]) -> &mut Self where T: Serializable, K: Borrow<T>,`

[src]

Appends a list of serializable structs to the end of the stream.

####
ⓘImportant traits for Bytes

### Important traits for Bytes

`impl Write for Bytes`

`pub fn out(self) -> Bytes`

[src]

Full stream.

## Trait Implementations

###

`impl Default for Stream`

[src]

####
ⓘImportant traits for Stream

### Important traits for Stream

`impl Write for Stream`

`fn default() -> Stream`

[src]

Returns the "default value" for a type. Read more

###

`impl Write for Stream`

[src]

####

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

[src]

Write a buffer into this object, returning how many bytes were written. Read more

####

`fn flush(&mut self) -> Result<(), Error>`

[src]

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

####

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

1.0.0
[src]

Attempts to write an entire buffer into this write. Read more

####

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

1.0.0
[src]

Writes a formatted string into this writer, returning any error encountered. Read more

####
ⓘImportant traits for &'a mut R

### Important traits for &'a mut R

`impl<'a, R> Read for &'a mut R where
R: Read + ?Sized, impl<'a, W> Write for &'a mut W where
W: Write + ?Sized, impl<'a, I> Iterator for &'a mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;`

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

1.0.0
[src]

Creates a "by reference" adaptor for this instance of `Write`. Read more

## Auto Trait Implementations

###

`impl Send for Stream`

###

`impl Sync for Stream`

## Blanket Implementations

###

`impl<T> From for T`

[src]

####

`fn from(t: T) -> T`

[src]

Performs the conversion.

###

`impl<T, U> Into for T where U: From<T>,`

[src]

####

`fn into(self) -> U`

[src]

Performs the conversion.

###

`impl<T, U> TryFrom for T where T: From<U>,`

[src]

#### `type Error = !`

🔬 This is a nightly-only experimental API. (`try_from`)

The type returned in the event of a conversion error.

####

`fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>`

[src]

🔬 This is a nightly-only experimental API. (`try_from`)

Performs the conversion.

###

`impl<T> Borrow for T where T: ?Sized,`

[src]

####
ⓘImportant traits for &'a mut R

### Important traits for &'a mut R

`impl<'a, R> Read for &'a mut R where
R: Read + ?Sized, impl<'a, W> Write for &'a mut W where
W: Write + ?Sized, impl<'a, I> Iterator for &'a mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;`

`fn borrow(&self) -> &T`

[src]

Immutably borrows from an owned value. Read more

###

`impl<T, U> TryInto for T where U: TryFrom<T>,`

[src]

#### `type Error = <U as TryFrom<T>>::Error`

🔬 This is a nightly-only experimental API. (`try_from`)

The type returned in the event of a conversion error.

####

`fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>`

[src]

🔬 This is a nightly-only experimental API. (`try_from`)

Performs the conversion.

###

`impl<T> BorrowMut for T where T: ?Sized,`

[src]

####
ⓘImportant traits for &'a mut R

### Important traits for &'a mut R

`impl<'a, R> Read for &'a mut R where
R: Read + ?Sized, impl<'a, W> Write for &'a mut W where
W: Write + ?Sized, impl<'a, I> Iterator for &'a mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;`

`fn borrow_mut(&mut self) -> &mut T`

[src]

Mutably borrows from an owned value. Read more

###

`impl<T> Any for T where T: 'static + ?Sized,`

[src]

####

`fn get_type_id(&self) -> TypeId`

[src]

🔬 This is a nightly-only experimental API. (`get_type_id`)

this method will likely be replaced by an associated static

Gets the `TypeId` of `self`. Read more

###

`impl<W> WriteBytesExt for W where W: Write + ?Sized,`

[src]

####

`fn write_u8(&mut self, n: u8) -> Result<(), Error>`

[src]

Writes an unsigned 8 bit integer to the underlying writer. Read more

####

`fn write_i8(&mut self, n: i8) -> Result<(), Error>`

[src]

Writes a signed 8 bit integer to the underlying writer. Read more

####

`fn write_u16<T>(&mut self, n: u16) -> Result<(), Error> where T: ByteOrder,`

[src]

Writes an unsigned 16 bit integer to the underlying writer. Read more

####

`fn write_i16<T>(&mut self, n: i16) -> Result<(), Error> where T: ByteOrder,`

[src]

Writes a signed 16 bit integer to the underlying writer. Read more

####

`fn write_u24<T>(&mut self, n: u32) -> Result<(), Error> where T: ByteOrder,`

[src]

Writes an unsigned 24 bit integer to the underlying writer. Read more

####

`fn write_i24<T>(&mut self, n: i32) -> Result<(), Error> where T: ByteOrder,`

[src]

Writes a signed 24 bit integer to the underlying writer. Read more

####

`fn write_u32<T>(&mut self, n: u32) -> Result<(), Error> where T: ByteOrder,`

[src]

Writes an unsigned 32 bit integer to the underlying writer. Read more

####

`fn write_i32<T>(&mut self, n: i32) -> Result<(), Error> where T: ByteOrder,`

[src]

Writes a signed 32 bit integer to the underlying writer. Read more

####

`fn write_u64<T>(&mut self, n: u64) -> Result<(), Error> where T: ByteOrder,`

[src]

Writes an unsigned 64 bit integer to the underlying writer. Read more

####

`fn write_i64<T>(&mut self, n: i64) -> Result<(), Error> where T: ByteOrder,`

[src]

Writes a signed 64 bit integer to the underlying writer. Read more

####

`fn write_uint<T>(&mut self, n: u64, nbytes: usize) -> Result<(), Error> where T: ByteOrder,`

[src]

Writes an unsigned n-bytes integer to the underlying writer. Read more

####

`fn write_int<T>(&mut self, n: i64, nbytes: usize) -> Result<(), Error> where T: ByteOrder,`

[src]

Writes a signed n-bytes integer to the underlying writer. Read more

####

`fn write_f32<T>(&mut self, n: f32) -> Result<(), Error> where T: ByteOrder,`

[src]

Writes a IEEE754 single-precision (4 bytes) floating point number to the underlying writer. Read more

####

`fn write_f64<T>(&mut self, n: f64) -> Result<(), Error> where T: ByteOrder,`

[src]

Writes a IEEE754 double-precision (8 bytes) floating point number to the underlying writer. Read more

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g. `str,u8` or `String,struct:Vec,test`)