Update so dependents can compile (#111)
Add missing `unstable` flag to fns.
This commit is contained in:
committed by
Carl Lerche
parent
b99c513334
commit
4f4fa3ea52
@@ -6,7 +6,7 @@ use http::{uri, HeaderMap, Method, StatusCode, Uri};
|
|||||||
use http::header::{self, HeaderName, HeaderValue};
|
use http::header::{self, HeaderName, HeaderValue};
|
||||||
|
|
||||||
use byteorder::{BigEndian, ByteOrder};
|
use byteorder::{BigEndian, ByteOrder};
|
||||||
use bytes::{BufMut, Bytes, BytesMut};
|
use bytes::{Bytes, BytesMut};
|
||||||
use string::String;
|
use string::String;
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
@@ -262,23 +262,6 @@ impl fmt::Debug for Headers {
|
|||||||
// ===== impl PushPromise =====
|
// ===== impl PushPromise =====
|
||||||
|
|
||||||
impl PushPromise {
|
impl PushPromise {
|
||||||
pub fn new(
|
|
||||||
stream_id: StreamId,
|
|
||||||
promised_id: StreamId,
|
|
||||||
pseudo: Pseudo,
|
|
||||||
fields: HeaderMap,
|
|
||||||
) -> Self {
|
|
||||||
PushPromise {
|
|
||||||
flags: PushPromiseFlag::default(),
|
|
||||||
header_block: HeaderBlock {
|
|
||||||
fields,
|
|
||||||
pseudo,
|
|
||||||
},
|
|
||||||
promised_id,
|
|
||||||
stream_id,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Loads the push promise frame but doesn't actually do HPACK decoding.
|
/// Loads the push promise frame but doesn't actually do HPACK decoding.
|
||||||
///
|
///
|
||||||
/// HPACK decoding is done in the `load_hpack` step.
|
/// HPACK decoding is done in the `load_hpack` step.
|
||||||
@@ -336,19 +319,9 @@ impl PushPromise {
|
|||||||
self.flags.is_end_headers()
|
self.flags.is_end_headers()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn into_parts(self) -> (Pseudo, HeaderMap) {
|
|
||||||
(self.header_block.pseudo, self.header_block.fields)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn fields(&self) -> &HeaderMap {
|
|
||||||
&self.header_block.fields
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn into_fields(self) -> HeaderMap {
|
|
||||||
self.header_block.fields
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn encode(self, encoder: &mut hpack::Encoder, dst: &mut BytesMut) -> Option<Continuation> {
|
pub fn encode(self, encoder: &mut hpack::Encoder, dst: &mut BytesMut) -> Option<Continuation> {
|
||||||
|
use bytes::BufMut;
|
||||||
|
|
||||||
let head = self.head();
|
let head = self.head();
|
||||||
let pos = dst.len();
|
let pos = dst.len();
|
||||||
|
|
||||||
@@ -372,6 +345,38 @@ impl PushPromise {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "unstable")]
|
||||||
|
impl PushPromise {
|
||||||
|
pub fn new(
|
||||||
|
stream_id: StreamId,
|
||||||
|
promised_id: StreamId,
|
||||||
|
pseudo: Pseudo,
|
||||||
|
fields: HeaderMap,
|
||||||
|
) -> Self {
|
||||||
|
PushPromise {
|
||||||
|
flags: PushPromiseFlag::default(),
|
||||||
|
header_block: HeaderBlock {
|
||||||
|
fields,
|
||||||
|
pseudo,
|
||||||
|
},
|
||||||
|
promised_id,
|
||||||
|
stream_id,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn into_parts(self) -> (Pseudo, HeaderMap) {
|
||||||
|
(self.header_block.pseudo, self.header_block.fields)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn fields(&self) -> &HeaderMap {
|
||||||
|
&self.header_block.fields
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn into_fields(self) -> HeaderMap {
|
||||||
|
self.header_block.fields
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<T> From<PushPromise> for Frame<T> {
|
impl<T> From<PushPromise> for Frame<T> {
|
||||||
fn from(src: PushPromise) -> Self {
|
fn from(src: PushPromise) -> Self {
|
||||||
Frame::PushPromise(src)
|
Frame::PushPromise(src)
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ impl Settings {
|
|||||||
self.max_concurrent_streams
|
self.max_concurrent_streams
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "unstable")]
|
||||||
pub fn set_max_concurrent_streams(&mut self, max: Option<u32>) {
|
pub fn set_max_concurrent_streams(&mut self, max: Option<u32>) {
|
||||||
self.max_concurrent_streams = max;
|
self.max_concurrent_streams = max;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user