class documentation
class Repeated(MutableSequence[
Constructor: Repeated(source, wrap, unwrap, mask_function)
Wrapper for protobuf repeated fields.
Provides wrapping/unwrapping logic and reset mask calculation for repeated fields containing messages or scalar values.
| Parameters | |
| source | Underlying protobuf sequence. |
| wrap | Optional wrapper for inner values. |
| unwrap | Optional unwrapping function for outer values. |
| mask | Optional mask builder for elements. |
| Class Method | with |
Create a factory that wraps protobuf repeated fields. |
| Method | __delitem__ |
Delete an item or slice from the sequence. |
| Method | __getitem__ |
Return an item or slice from the sequence. |
| Method | __init__ |
Wrap a protobuf repeated field. |
| Method | __len__ |
Return the number of elements. |
| Method | __repr__ |
Return a multi-line representation of the sequence. |
| Method | __setitem__ |
Set an item or slice in the sequence. |
| Method | get |
Compute the reset mask for a full update of this sequence. |
| Method | get |
Return the mask for this repeated field if empty. |
| Method | insert |
Insert a value into the repeated field. |
| Instance Variable | _mask |
Undocumented |
| Instance Variable | _source |
Undocumented |
| Instance Variable | _unwrap |
Undocumented |
| Instance Variable | _wrap |
Undocumented |
@classmethod
def with_wrap(cls, wrap:
def with_wrap(cls, wrap:
Callable[ [ CollectibleInner], CollectibleOuter] | None = None, unwrap: Callable[ [ CollectibleOuter], CollectibleInner] | None = None, mask_function: MaskFunction | None = None) -> Callable[ [ MutableSequence[ CollectibleInner]], Repeated[ CollectibleOuter]]:
(source)
¶
Create a factory that wraps protobuf repeated fields.
| Parameters | |
wrap:Callable[ | Optional wrapper for inner values. |
unwrap:Callable[ | Optional unwrapping function for outer values. |
maskMaskFunction | None | Optional mask builder for elements. |
| Returns | |
Callable[ | Callable that wraps a repeated field. |
Return an item or slice from the sequence.
| Parameters | |
index:int | slice | Integer index or slice. |
| Returns | |
CollectibleOuter | MutableSequence[ | Wrapped value or list of wrapped values. |
def __init__(self, source:
MutableSequence[ CollectibleInner], wrap: Callable[ [ CollectibleInner], CollectibleOuter] | None = None, unwrap: Callable[ [ CollectibleOuter], CollectibleInner] | None = None, mask_function: MaskFunction | None = None):
(source)
¶
Wrap a protobuf repeated field.
def __setitem__(self, index:
int | slice, value: CollectibleOuter | Iterable[ CollectibleOuter]):
(source)
¶
Set an item or slice in the sequence.
| Parameters | |
index:int | slice | Integer index or slice. |
value:CollectibleOuter | Iterable[ | Value or iterable of values. |
Insert a value into the repeated field.
| Parameters | |
index:int | Insert position. |
value:CollectibleOuter | Value to insert. |