nntp.fifo
=========
.. py:module:: nntp.fifo
.. autoapi-nested-parse::
A reasonably efficient FIFO buffer.
Copyright (C) 2013-2020 Byron Platt
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Classes
-------
.. autoapisummary::
nntp.fifo.Fifo
nntp.fifo.TextFifo
nntp.fifo.BytesFifo
Module Contents
---------------
.. py:class:: Fifo(data: T | None = None)
Bases: :py:obj:`Generic`\ [\ :py:obj:`T`\ ]
.. py:attribute:: empty
:type: T
.. py:attribute:: eol
:type: T
.. py:attribute:: buf
:type: T
.. py:attribute:: buflist
:type: list[T]
:value: []
.. py:attribute:: pos
:value: 0
.. py:method:: __len__() -> int
.. py:method:: __iter__() -> typing_extensions.Self
.. py:method:: __next__() -> T
.. py:method:: __discard() -> None
.. py:method:: __append() -> None
.. py:method:: clear() -> None
.. py:method:: write(data: T) -> None
.. py:method:: read(length: int = 0) -> T
.. py:method:: readline() -> T
.. py:method:: readuntil(token: T, size: int = 0) -> tuple[bool, T]
.. py:method:: peek(length: int = 0) -> T
.. py:method:: peekline() -> T
.. py:method:: peekuntil(token: T, size: int = 0) -> tuple[bool, T]
.. py:class:: TextFifo(data: T | None = None)
Bases: :py:obj:`Fifo`\ [\ :py:obj:`str`\ ]
.. py:attribute:: empty
:value: ''
.. py:attribute:: eol
:value: Multiline-String
.. raw:: html
Show Value
.. code-block:: python
"""
"""
.. raw:: html
.. py:class:: BytesFifo(data: T | None = None)
Bases: :py:obj:`Fifo`\ [\ :py:obj:`bytes`\ ]
.. py:attribute:: empty
:value: b''
.. py:attribute:: eol
:value: b'\r\n'