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`.`web`.`_newclient`.`LengthEnforcingConsumer``

class documentation

`class LengthEnforcingConsumer: (source)`

View In Hierarchy

An `IConsumer` proxy which enforces an exact length requirement on the total data written to it.

Method | `__init__` | Undocumented
Method | `write` | Write `bytes` to the underlying consumer unless `_noMoreWritesExpected` has been called or there are/have been too many bytes.
Method | `_allowNoMoreWrites` | Indicate that no additional writes are allowed. Attempts to write after calling this method will be met with an exception.
Method | `_noMoreWritesExpected` | Called to indicate no more bytes will be written to this consumer. Check to see that the correct number have been written.
Instance Variable | `_consumer` | The consumer to which at most `_length` bytes will be forwarded.
Instance Variable | `_finished` | A `Deferred` which will be fired with a `Failure` if too many bytes are written to this consumer.
Instance Variable | `_length` | The number of bytes remaining to be written.
Instance Variable | `_producer` | The `IBodyProducer` which is writing to this consumer.

def __init__(self, producer, consumer, finished): (source)

Undocumented

def write(self, bytes): (source)

Write `bytes` to the underlying consumer unless `_noMoreWritesExpected` has been called or there are/have been too many bytes.

def _allowNoMoreWrites(self): (source)

Indicate that no additional writes are allowed. Attempts to write after calling this method will be met with an exception.

def _noMoreWritesExpected(self): (source)

Called to indicate no more bytes will be written to this consumer. Check to see that the correct number have been written.

Raises
`WrongBodyLength` | If not enough bytes have been written.

_consumer = (source)

The consumer to which at most `_length` bytes will be forwarded.

_finished = (source)

A `Deferred` which will be fired with a `Failure` if too many bytes are written to this consumer.

_length = (source)

The number of bytes remaining to be written.

_producer = (source)

The `IBodyProducer` which is writing to this consumer.