pyrtma.validators.StructArray
- class StructArray(msg_struct, len)[source]
Bases:
FieldValidator,Sequence,Generic[_S]Validator for structure arrays
Validator for structure arrays
- Parameters:
msg_struct (
Type[TypeVar(_S, bound=MessageBase)]) – Structure classlen (
int) – Array length
Methods
Raises ValueError if the value is not present.
Generate formatted string for structure array
Validate structure array
Validate multiple structures
Validate a structure
- count(value) integer -- return number of occurrences of value
- index(value[, start[, stop]]) integer -- return first index of value.
Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- validate_array(value)[source]
Validate structure array
- Parameters:
value (
StructArray[TypeVar(_S, bound=MessageBase)]) – StructArray to validate- Raises:
TypeError – Wrong type
- validate_many(value)[source]
Validate multiple structures
- Parameters:
value (
Iterable[TypeVar(_S, bound=MessageBase)]) – Structure values to validate
- validate_one(value)[source]
Validate a structure
- Parameters:
value (
TypeVar(_S, bound=MessageBase)) – Structure value to validate