Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: a couple of docs improvements #20

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stun-types/src/attribute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
//! }
//! impl<'a> From<&MyAttribute> for RawAttribute<'a> {
//! fn from(value: &MyAttribute) -> RawAttribute<'a> {
//! let mut ret = vec![0; 4];
//! let mut ret = [0; 4];
//! BigEndian::write_u32(&mut ret, value.value);
//! RawAttribute::new(MyAttribute::TYPE, &ret).into_owned()
//! }
Expand Down
4 changes: 4 additions & 0 deletions stun-types/src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Data handling
//!
//! Provides a CoW interface for slices of `[u8]` and `Box<[u8]>`

/// A slice of data
#[derive(Debug, Clone, PartialEq, Eq)]
#[repr(transparent)]
Expand Down
7 changes: 4 additions & 3 deletions stun-types/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
//! 0x00, 0x00, 0x00, 0x00, // \
//! 0x00, 0x00, 0x00, 0x00, // } transaction ID
//! 0x00, 0x00, 0x73, 0x92, // /
//! 0x00, 0x1D, 0x00, 0x04, // PasswordAlgorithm ttribute
//! 0x00, 0x02, 0x00, 0x00 // PasswordAlgorithm attribute
//! 0x00, 0x1D, 0x00, 0x04, // PasswordAlgorithm attribute header (type and length)
//! 0x00, 0x02, 0x00, 0x00 // PasswordAlgorithm attribute value
//! ];
//! let msg = Message::from_bytes(&msg_data).unwrap();
//!
Expand Down Expand Up @@ -84,7 +84,7 @@ use crate::attribute::*;

use tracing::{debug, warn};

/// The value of magic cookie (in network byte order) as specified in RFC5389, and RFC8489.
/// The value of the magic cookie (in network byte order) as specified in RFC5389, and RFC8489.
pub const MAGIC_COOKIE: u32 = 0x2112A442;

/// The value of the binding message type. Can be used in either a request or an indication
Expand Down Expand Up @@ -1331,6 +1331,7 @@ impl<'a> Iterator for MessageAttributesIter<'a> {
}
}

/// A builder of a STUN Message to a sequence of bytes.
#[derive(Clone, Debug)]
pub struct MessageBuilder<'a> {
msg_type: MessageType,
Expand Down
Loading