(cls, state: serializable.State)
| 182 | |
| 183 | @classmethod |
| 184 | def from_state(cls, state: serializable.State) -> Flow: |
| 185 | try: |
| 186 | flow_cls = Flow.__types[state["type"]] |
| 187 | except KeyError: |
| 188 | raise ValueError(f"Unknown flow type: {state['type']}") |
| 189 | client = connection.Client(peername=("", 0), sockname=("", 0)) |
| 190 | server = connection.Server(address=None) |
| 191 | f = flow_cls(client, server) |
| 192 | f.set_state(state) |
| 193 | return f |
| 194 | |
| 195 | def copy(self): |
| 196 | """Make a copy of this flow.""" |