Method
try_into_from_object
(vm: &VirtualMachine, obj: PyObjectRef)
Source from the content-addressed store, hash-verified
| 559 | |
| 560 | impl ArrayElement for WideChar { |
| 561 | fn try_into_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self> { |
| 562 | PyUtf8StrRef::try_from_object(vm, obj)? |
| 563 | .as_str() |
| 564 | .chars() |
| 565 | .exactly_one() |
| 566 | .map(|ch| Self(ch as _)) |
| 567 | .map_err(|_| vm.new_type_error("array item must be unicode character")) |
| 568 | } |
| 569 | fn byteswap(self) -> Self { |
| 570 | Self(self.0.swap_bytes()) |
| 571 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected