Trailer returns the cached trailer metadata. Note that if it is not called after the entire stream is done, it could return an empty MD. It can be safely read only after stream has ended that is either read or write have returned io.EOF.
()
| 337 | // It can be safely read only after stream has ended that is either read |
| 338 | // or write have returned io.EOF. |
| 339 | func (s *Stream) Trailer() metadata.MD { |
| 340 | return s.trailer.Copy() |
| 341 | } |
| 342 | |
| 343 | // Context returns the context of the stream. |
| 344 | func (s *Stream) Context() context.Context { |