Cmpnt¶
- class zixy.container.cmpnts.Cmpnt(impl: ImplT, indexer: int | None = None)[source]¶
Bases:
ViewableItem[ImplT],Generic[ImplT,SpecT],StringRepresentableA component.
A single component that may be an owning instance referencing a single element in a Rust-bound data object, or a view on an element in another collection.
- __init__(impl: ImplT, indexer: int | None = None)[source]¶
Initialize the component.
- Parameters:
impl – Rust-bound object storing the data.
indexer – Position within Rust-bound array at which the viewed component is stored. When
indexerisNone, theCmpntis an owning view on the sole element ofimpl.
- aliases(other: Cmpnt[ImplT, SpecT]) bool[source]¶
Determine whether
selfis a view of the same component asother.
- abstractmethod classmethod from_str(source: str, *args: Any, **kwargs: Any) Self¶
Create an instance of
clsfrom a string.- Parameters:
source – String to parse.
*args – Positional arguments to forward to a subsequent constructor.
**kwargs – Keyword arguments to forward to a subsequent constructor.
- Returns:
An instance of
clsparsed fromsource.
- into(t: type[OutT]) OutT¶
Clone
selfinto a new related container of typet.- Parameters:
t – Type of the new container to create.
- Returns:
A new instance of
tcontaining the same data asself.
- classmethod parse(source: str) Self¶
Parse a string into an instance of
cls.- Deprecated:
use
from_str()instead.
- Parameters:
source – String to parse.
- Returns:
An instance of
clsparsed fromsource.