Exemplo n.º 1
0
 def from_state(cls, state):
     state["headers"] = Headers.from_state(state["headers"])
     if state["trailers"] is not None:
         state["trailers"] = Headers.from_state(state["trailers"])
     return cls(**state)
Exemplo n.º 2
0
 def set_state(self, state):
     for k, v in state.items():
         if k in ("headers", "trailers") and v is not None:
             v = Headers.from_state(v)
         setattr(self, k, v)