---
title: llarp::quic::Stream

---

# llarp::quic::Stream





Inherits from std::enable_shared_from_this< Stream >

## Public Types

|                | Name           |
| -------------- | -------------- |
| using std::function< void([Stream](Classes/classllarp_1_1quic_1_1Stream.md) &, bstring_view)> | **[data_callback_t](Classes/classllarp_1_1quic_1_1Stream.md#using-data-callback-t)**  |
| using std::function< void([Stream](Classes/classllarp_1_1quic_1_1Stream.md) &, std::optional< uint64_t > error_code)> | **[close_callback_t](Classes/classllarp_1_1quic_1_1Stream.md#using-close-callback-t)**  |
| using std::function< bool([Stream](Classes/classllarp_1_1quic_1_1Stream.md) &)> | **[unblocked_callback_t](Classes/classllarp_1_1quic_1_1Stream.md#using-unblocked-callback-t)**  |

## Public Functions

|                | Name           |
| -------------- | -------------- |
| const [StreamID](Classes/structllarp_1_1quic_1_1StreamID.md) & | **[id](Classes/classllarp_1_1quic_1_1Stream.md#function-id)**() const |
| void | **[set_buffer_size](Classes/classllarp_1_1quic_1_1Stream.md#function-set-buffer-size)**(size_t size) |
| size_t | **[buffer_size](Classes/classllarp_1_1quic_1_1Stream.md#function-buffer-size)**() const |
| size_t | **[available](Classes/classllarp_1_1quic_1_1Stream.md#function-available)**() const |
| size_t | **[used](Classes/classllarp_1_1quic_1_1Stream.md#function-used)**() const |
| size_t | **[unacked](Classes/classllarp_1_1quic_1_1Stream.md#function-unacked)**() const |
| size_t | **[unsent](Classes/classllarp_1_1quic_1_1Stream.md#function-unsent)**() const |
| bool | **[append](Classes/classllarp_1_1quic_1_1Stream.md#function-append)**(bstring_view data) |
| bool | **[append](Classes/classllarp_1_1quic_1_1Stream.md#function-append)**(std::string_view data) |
| size_t | **[append_any](Classes/classllarp_1_1quic_1_1Stream.md#function-append-any)**(bstring_view data) |
| size_t | **[append_any](Classes/classllarp_1_1quic_1_1Stream.md#function-append-any)**(std::string_view data) |
| void | **[append_buffer](Classes/classllarp_1_1quic_1_1Stream.md#function-append-buffer)**(const std::byte * buf, size_t length) |
| void | **[close](Classes/classllarp_1_1quic_1_1Stream.md#function-close)**(std::optional< uint64_t > error_code =std::nullopt) |
| bool | **[closing](Classes/classllarp_1_1quic_1_1Stream.md#function-closing)**() const |
| void | **[when_available](Classes/classllarp_1_1quic_1_1Stream.md#function-when-available)**(unblocked_callback_t unblocked_cb) |
| void | **[io_ready](Classes/classllarp_1_1quic_1_1Stream.md#function-io-ready)**() |
| void | **[available_ready](Classes/classllarp_1_1quic_1_1Stream.md#function-available-ready)**() |
| void | **[data](Classes/classllarp_1_1quic_1_1Stream.md#function-data)**(std::shared_ptr< void > data) |
| void | **[weak_data](Classes/classllarp_1_1quic_1_1Stream.md#function-weak-data)**(std::weak_ptr< void > data) |
| template <typename T \> <br>std::shared_ptr< T > | **[data](Classes/classllarp_1_1quic_1_1Stream.md#function-data)**() const |
| [Connection](Classes/classllarp_1_1quic_1_1Connection.md) & | **[get_connection](Classes/classllarp_1_1quic_1_1Stream.md#function-get-connection)**() |
| | **[~Stream](Classes/classllarp_1_1quic_1_1Stream.md#function-~stream)**() |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| data_callback_t | **[data_callback](Classes/classllarp_1_1quic_1_1Stream.md#variable-data-callback)**  |
| close_callback_t | **[close_callback](Classes/classllarp_1_1quic_1_1Stream.md#variable-close-callback)**  |

## Friends

|                | Name           |
| -------------- | -------------- |
| class | **[Connection](Classes/classllarp_1_1quic_1_1Stream.md#friend-connection)**  |

## Public Types Documentation

### using data_callback_t

```cpp
using llarp::quic::Stream::data_callback_t =  std::function<void(Stream&, bstring_view)>;
```


### using close_callback_t

```cpp
using llarp::quic::Stream::close_callback_t =  std::function<void(Stream&, std::optional<uint64_t> error_code)>;
```


### using unblocked_callback_t

```cpp
using llarp::quic::Stream::unblocked_callback_t =  std::function<bool(Stream&)>;
```


## Public Functions Documentation

### function id

```cpp
inline const StreamID & id() const
```


### function set_buffer_size

```cpp
void set_buffer_size(
    size_t size
)
```


### function buffer_size

```cpp
size_t buffer_size() const
```


### function available

```cpp
inline size_t available() const
```


### function used

```cpp
inline size_t used() const
```


### function unacked

```cpp
inline size_t unacked() const
```


### function unsent

```cpp
inline size_t unsent() const
```


### function append

```cpp
bool append(
    bstring_view data
)
```


### function append

```cpp
inline bool append(
    std::string_view data
)
```


### function append_any

```cpp
size_t append_any(
    bstring_view data
)
```


### function append_any

```cpp
inline size_t append_any(
    std::string_view data
)
```


### function append_buffer

```cpp
void append_buffer(
    const std::byte * buf,
    size_t length
)
```


### function close

```cpp
void close(
    std::optional< uint64_t > error_code =std::nullopt
)
```


### function closing

```cpp
inline bool closing() const
```


### function when_available

```cpp
void when_available(
    unblocked_callback_t unblocked_cb
)
```


### function io_ready

```cpp
void io_ready()
```


### function available_ready

```cpp
void available_ready()
```


### function data

```cpp
void data(
    std::shared_ptr< void > data
)
```


### function weak_data

```cpp
void weak_data(
    std::weak_ptr< void > data
)
```


### function data

```cpp
template <typename T >
inline std::shared_ptr< T > data() const
```


### function get_connection

```cpp
inline Connection & get_connection()
```


### function ~Stream

```cpp
~Stream()
```


## Public Attributes Documentation

### variable data_callback

```cpp
data_callback_t data_callback;
```


### variable close_callback

```cpp
close_callback_t close_callback;
```


## Friends

### friend Connection

```cpp
friend class Connection(
    Connection 
);
```


-------------------------------

Updated on 2023-01-26 at 19:35:17 +0000