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`.`internet`.`fdesc``

module documentation
(source)

Utility functions for dealing with POSIX file descriptors.

Function | `readFromFD` | Read from file descriptor, calling callback with resulting data.
Function | `setBlocking` | Set the file description of the given file descriptor to blocking.
Function | `setNonBlocking` | Set the file description of the given file descriptor to non-blocking.
Function | `writeToFD` | Write data to file descriptor.
Variable | `_setCloseOnExec` | Undocumented
Variable | `_unsetCloseOnExec` | Undocumented

def readFromFD(fd, callback): (source)

Read from file descriptor, calling callback with resulting data.

If successful, call 'callback' with a single argument: the resulting data.

Returns same thing FileDescriptor.doRead would: CONNECTION_LOST, CONNECTION_DONE, or None.

Parameters
fd:`int` | non-blocking file descriptor to be read from.
callback | a callable which accepts a single argument. If data is read from the file descriptor it will be called with this data. Handling exceptions from calling the callback is up to the caller. Note that if the descriptor is still connected but no data is read, None will be returned but callback will not be called.
Returns
CONNECTION_LOST on error, CONNECTION_DONE when fd is closed, otherwise None.

def setBlocking(fd): (source)

Set the file description of the given file descriptor to blocking.

def setNonBlocking(fd): (source)

Set the file description of the given file descriptor to non-blocking.

def writeToFD(fd, data): (source)

Write data to file descriptor.

Returns same thing FileDescriptor.writeSomeData would.

Parameters
fd:`int` | non-blocking file descriptor to be written to.
data:`str` or `buffer` | bytes to write to fd.
Returns
number of bytes written, or CONNECTION_LOST.

_setCloseOnExec = (source)

Undocumented

_unsetCloseOnExec = (source)

Undocumented