ResponseTrailerMap& FilterManager::addEncodedTrailers() {
  // Trailers can only be added during the last data frame (i.e. end_stream = true).
  ASSERT(state_.filter_call_state_ & FilterCallState::LastDataFrame);

  // Trailers can only be added once.
  ASSERT(!filter_manager_callbacks_.responseTrailers());

  filter_manager_callbacks_.setResponseTrailers(ResponseTrailerMapImpl::create());
  return *filter_manager_callbacks_.responseTrailers();
}
ResponseTrailerMap& FilterManager::addEncodedTrailers() {
   
  ASSERT(state_.filter_call_state_ & FilterCallState::LastDataFrame);

   
  ASSERT(!filter_manager_callbacks_.responseTrailers());

  filter_manager_callbacks_.setResponseTrailers(ResponseTrailerMapImpl::create());
  return *filter_manager_callbacks_.responseTrailers();
}