Adds Default implementation for UncompressedExt

pull/144/head
SirCipher 5 years ago
parent 4714182f11
commit 31b50bf6b5
  1. 10
      src/extensions/uncompressed.rs

@ -3,6 +3,7 @@ use crate::protocol::frame::coding::{Data, OpCode};
use crate::protocol::frame::Frame;
use crate::protocol::message::{IncompleteMessage, IncompleteMessageType};
use crate::{Error, Message};
use crate::protocol::MAX_MESSAGE_SIZE;
/// An uncompressed message handler for a WebSocket.
#[derive(Debug)]
@ -11,6 +12,15 @@ pub struct UncompressedExt {
max_message_size: Option<usize>,
}
impl Default for UncompressedExt {
fn default() -> Self {
UncompressedExt {
incomplete: None,
max_message_size: Some(MAX_MESSAGE_SIZE)
}
}
}
impl UncompressedExt {
/// Builds a new `UncompressedExt` that will permit a maximum message size of `max_message_size`
/// or will be unbounded if `None`.

Loading…
Cancel
Save