Skip to content

Commit b941518

Browse files
committed
Update conditionals docs, mark subdirs as pub
1 parent 80b7d64 commit b941518

File tree

7 files changed

+28
-9
lines changed

7 files changed

+28
-9
lines changed

src/conditional/if_match.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Apply the HTTP method if the ETag matches.
2+
13
use crate::conditional::MatchDirective;
24
use crate::headers::{HeaderName, HeaderValue, Headers, ToHeaderValues, IF_MATCH};
35

@@ -6,7 +8,7 @@ use std::iter::Iterator;
68
use std::option;
79
use std::slice;
810

9-
/// HTTP `If-Match` header.
11+
/// Apply the HTTP method if the ETag matches.
1012
///
1113
/// # Specifications
1214
///

src/conditional/if_modified_since.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ use std::fmt::Debug;
55
use std::option;
66
use std::time::SystemTime;
77

8-
/// HTTP `IfModifiedSince` header
8+
/// Apply the HTTP method if the entity has been modified after the given
9+
/// date.
910
///
1011
/// # Specifications
1112
///

src/conditional/if_none_match.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
//! Apply the HTTP method if the ETags do not match.
2+
//!
3+
//! This is used to update caches or to prevent uploading a new resource when
4+
//! one already exists.
5+
16
use crate::conditional::MatchDirective;
27
use crate::headers::{HeaderName, HeaderValue, Headers, ToHeaderValues, IF_NONE_MATCH};
38

@@ -6,7 +11,10 @@ use std::iter::Iterator;
611
use std::option;
712
use std::slice;
813

9-
/// HTTP `If-None-Match` header.
14+
/// Apply the HTTP method if the ETags do not match.
15+
///
16+
/// This is used to update caches or to prevent uploading a new resource when
17+
/// one already exists.
1018
///
1119
/// # Specifications
1220
///

src/conditional/if_unmodified_since.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ use std::fmt::Debug;
55
use std::option;
66
use std::time::SystemTime;
77

8-
/// HTTP `IfUnmodifiedSince` header
8+
/// Apply the HTTP method if the entity has not been modified after the
9+
/// given date.
910
///
1011
/// # Specifications
1112
///

src/conditional/last_modified.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::fmt::Debug;
55
use std::option;
66
use std::time::SystemTime;
77

8-
/// HTTP `LastModified` header
8+
/// The last modification date of a resource.
99
///
1010
/// # Specifications
1111
///

src/conditional/match_directive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::conditional::ETag;
22
use crate::headers::HeaderValue;
33

4-
/// An Entity Tag based match directive.
4+
/// An ETag-based match directive.
55
#[derive(Debug, Clone, PartialEq, Eq)]
66
pub enum MatchDirective {
77
/// An ETag.

src/conditional/mod.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,24 @@
99
//! - [MDN: HTTP Conditional Requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Conditional_requests)
1010
1111
mod etag;
12-
mod if_match;
1312
mod if_modified_since;
14-
mod if_none_match;
1513
mod if_unmodified_since;
1614
mod last_modified;
1715
mod match_directive;
1816

17+
pub mod if_match;
18+
pub mod if_none_match;
19+
1920
pub use etag::ETag;
21+
pub use match_directive::MatchDirective;
22+
23+
#[doc(inline)]
2024
pub use if_match::IfMatch;
25+
#[doc(inline)]
2126
pub use if_modified_since::IfModifiedSince;
27+
#[doc(inline)]
2228
pub use if_none_match::IfNoneMatch;
29+
#[doc(inline)]
2330
pub use if_unmodified_since::IfUnmodifiedSince;
31+
#[doc(inline)]
2432
pub use last_modified::LastModified;
25-
pub use match_directive::MatchDirective;

0 commit comments

Comments
 (0)