# [−] Struct rpc::MetaIoHandler

    pub struct MetaIoHandler<T, S = Noop> where
        S: Middleware<T>,
        T: Metadata,  { /* fields omitted */ }

Request handler

By default compatible only with jsonrpc v2

## Methods

###

`impl<T> MetaIoHandler<T, Noop> where T: Metadata,`

####

`pub fn with_compatibility( compatibility: Compatibility ) -> MetaIoHandler<T, Noop>` |

Creates new `MetaIoHandler` compatible with specified protocol version.

###

`impl<T, S> MetaIoHandler<T, S> where S: Middleware<T>, T: Metadata,`

####

`pub fn new(compatibility: Compatibility, middleware: S) -> MetaIoHandler<T, S>` |

Creates new `MetaIoHandler`

####

`pub fn with_middleware(middleware: S) -> MetaIoHandler<T, S>` |

Creates new `MetaIoHandler` with specified middleware.

####

`pub fn add_alias(&mut self, alias: &str, other: &str)` |

Adds an alias to a method.

####

`pub fn add_method<F>(&mut self, name: &str, method: F) where F: RpcMethodSimple,` |

Adds new supported asynchronous method

####

`pub fn add_notification<F>(&mut self, name: &str, notification: F) where F: RpcNotificationSimple,` |

Adds new supported notification

####

`pub fn add_method_with_meta<F>(&mut self, name: &str, method: F) where F: RpcMethod<T>,` |

Adds new supported asynchronous method with metadata support.

####

`pub fn add_notification_with_meta<F>(&mut self, name: &str, notification: F) where F: RpcNotification<T>,` |

Adds new supported notification with metadata support.

####

`pub fn extend_with<F>(&mut self, methods: F) where F: Into<HashMap<String, RemoteProcedure<T>, RandomState>>,` |

Extend this `MetaIoHandler` with methods defined elsewhere.

####

`pub fn handle_request_sync(&self, request: &str, meta: T) -> Option<String>` |

Handle given request synchronously - will block until response is available. If you have any asynchronous methods in your RPC it is much wiser to use `handle_request` instead and deal with asynchronous requests in a non-blocking fashion.

####

`pub fn handle_request( &self, request: &str, meta: T ) -> Map<Either<FutureResult<Option<Response>, ()>, <S as Middleware<T>>::Future>, fn(Option<Response>) -> Option<String>>` |

Handle given request asynchronously.

####

`pub fn handle_rpc_request( &self, request: Request, meta: T ) -> <S as Middleware<T>>::Future` |

Handle deserialized RPC request.

####

`pub fn handle_call( &self, call: Call, meta: T ) -> Either<Box<Future<Item = Option<Output>, Error = ()> + 'static + Send>, FutureResult<Option<Output>, ()>>` |

Handle single call asynchronously.

## Trait Implementations

###

`impl<T, S> Debug for MetaIoHandler<T, S> where S: Middleware<T> + Debug, T: Metadata + Debug,`

####

`fn fmt(&self, f: &mut Formatter) -> Result<(), Error>` |

Formats the value using the given formatter. Read more

###

`impl From<IoHandler<()>> for MetaIoHandler<(), Noop>`

####

`fn from(io: IoHandler<()>) -> MetaIoHandler<(), Noop>` |

Performs the conversion.

###

`impl<T> Default for MetaIoHandler<T, Noop> where T: Metadata,`

####

`fn default() -> MetaIoHandler<T, Noop>` |

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

###

`impl<T, S> Into<MetaIoHandler<T, S>> for PubSubHandler<T, S> where S: Middleware<T>, T: PubSubMetadata,`

####

`fn into(self) -> MetaIoHandler<T, S>` |

Performs the conversion.

## Auto Trait Implementations

###

`impl<T, S> Send for MetaIoHandler<T, S>`

###

`impl<T, S> Sync for MetaIoHandler<T, S>`

## 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<T> Erased for T`

# 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`)