Files
Alessandro Di Federico 289c6d4c04 tmp
2022-11-15 16:46:42 +01:00

35 lines
734 B
Python

#
# This file is distributed under the MIT License. See LICENSE.md for details.
#
from typing import Any, Dict, Generator, Optional
from ._capi import _api, ffi
from .kind import Kind
from .utils import make_python_string
class Pipe:
def __init__(self, pipe):
self._pipe = pipe
@property
def name(self) -> str:
_name = _api.rp_pipe_get_name(self._pipe)
return make_python_string(_name)
@property
def doc(self) -> str:
_doc = _api.rp_pipe_get_doc(self._pipe)
return make_python_string(_doc)
def as_dict(self) -> Dict[str, Any]:
return {
"name": self.name,
"doc": self.doc
}
def __hash__(self):
return id(self)