Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`protocols`.`amp`.`IArgumentType``

interface documentation

`class IArgumentType(Interface): (source)`

Known implementations: `twisted.protocols.amp.Argument`

View In Hierarchy

An `IArgumentType` can serialize a Python object into an AMP box and deserialize information from an AMP box back into a Python object.

Present Since
9.0

Method | `fromBox` | Given an argument name and an AMP box containing serialized values, extract one or more Python objects and add them to the `objects` dictionary.
Method | `toBox` | Given an argument name and a dictionary containing structured Python objects, serialize values into one or more strings and add them to the `strings` dictionary.

def fromBox(name, strings, objects, proto): (source)

Given an argument name and an AMP box containing serialized values, extract one or more Python objects and add them to the `objects` dictionary.

Parameters
name:`bytes` | The name associated with this argument. Most commonly this is the key which can be used to find a serialized value in `strings`.
strings:`dict` | The AMP box from which to extract one or more values.
objects:`dict` | The output dictionary to populate with the value for this argument. The key used will be derived from `name`. It may differ; in Python 3, for example, the key will be a Unicode/native string. See `_wireNameToPythonIdentifier`.
proto | The protocol instance which received the AMP box being interpreted. Most likely this is an instance of `AMP`, but this is not guaranteed.
Returns
`None`

def toBox(name, strings, objects, proto): (source)

Given an argument name and a dictionary containing structured Python objects, serialize values into one or more strings and add them to the `strings` dictionary.

Parameters
name:`bytes` | The name associated with this argument. Most commonly this is the key in `strings` to associate with a `bytes` giving the serialized form of that object.
strings:`dict` | The AMP box into which to insert one or more strings.
objects:`dict` | The input dictionary from which to extract Python objects to serialize. The key used will be derived from `name`. It may differ; in Python 3, for example, the key will be a Unicode/native string. See `_wireNameToPythonIdentifier`.
proto | The protocol instance which will send the AMP box once it is fully populated. Most likely this is an instance of `AMP`, but this is not guaranteed.
Returns
`None`