Skip to content

Commit e08e39a

Browse files
roypatLandon Johnson
andcommitted
Added doc string to Endpoint::new()
Resolve a TODO about documenting a panic condition. Closes #3636 Co-Authored-by: Landon Johnson <[email protected]> Signed-off-by: Patrick Roy <[email protected]>
1 parent 5a6424d commit e08e39a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/vmm/src/dumbo/tcp/endpoint.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,23 @@ pub struct Endpoint {
8181
// is the only option).
8282

8383
impl Endpoint {
84+
/// Creates a new Endpoint from a [`crate::tcp::connection::Connection`]
85+
/// ## Arguments:
86+
/// - `segment`: The incoming `SYN`.
87+
/// - `eviction_threshold`: CPU cycles that must elapse before this Endpoint is evictable
88+
/// - `connection_rto_period`: How long the connection waits before a retransmission timeout
89+
/// fires for the first segment which has not been acknowledged yet. This uses an opaque time
90+
/// unit.
91+
/// - `connection_rto_count_max`: How many consecutive timeout-based retransmission may occur
92+
/// before the connection resets itself.
93+
/// ## Panics:
94+
/// - `assert!(RCV_BUF_MAX_SIZE <= MAX_WINDOW_SIZE as usize);`
8495
pub fn new<T: NetworkBytes + Debug>(
8596
segment: &TcpSegment<T>,
8697
eviction_threshold: NonZeroU64,
8798
connection_rto_period: NonZeroU64,
8899
connection_rto_count_max: NonZeroU16,
89100
) -> Result<Self, PassiveOpenError> {
90-
// TODO: mention this in doc comment for function
91101
// This simplifies things, and is a very reasonable assumption.
92102
#[allow(clippy::assertions_on_constants)]
93103
{

0 commit comments

Comments
 (0)