Skip to content

Commit 079f398

Browse files
Merge pull request #651 from swimos/docs6
Tidy up of crate/module API: Stage 6
2 parents 2f7d9eb + e220a56 commit 079f398

File tree

123 files changed

+520
-1172
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+520
-1172
lines changed

api/formats/swimos_recon/src/recon_parser/record/matcher/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,22 @@ pub trait HeaderPeeler<'a>: Clone {
4343

4444
/// Provide the name of the tag attribute.
4545
///
46-
/// #Arguments
46+
/// # Arguments
4747
/// * `name` - The name of the tag. Note that this has a more restrictive lifetime as may
4848
/// have been unescaped by the parser.
4949
fn tag(self, name: &str) -> Result<Self, Self::Error>;
5050

5151
/// Feed a slot from the body of the attribute.
5252
///
53-
/// #Arguments
53+
/// # Arguments
5454
/// * `name` - The name of the slot. Note that this has a more restrictive lifetime as may
5555
/// have been unescaped by the parser.
5656
/// * `value` - Span of the input containing the Recon of the value of the slot.
5757
fn feed_header_slot(self, name: &str, value: Span<'a>) -> Result<Self, Self::Error>;
5858

5959
/// Feed a value item from the body of the attribute.
6060
///
61-
/// #Arguments
61+
/// # Arguments
6262
/// * `value` - Span of the input containing the Recon of the item
6363
fn feed_header_value(self, value: Span<'a>) -> Result<Self, Self::Error>;
6464

@@ -68,7 +68,7 @@ pub trait HeaderPeeler<'a>: Clone {
6868

6969
/// Attempt to interpret the attribute.
7070
///
71-
/// #Arguments
71+
/// # Arguments
7272
/// * `body` - The remainder of the input span. Note that this is entirely uninterpreted and
7373
/// so may not contain valid Recon.
7474
fn done(self, body: Span<'a>) -> Result<Self::Output, Self::Error>;

api/swimos_agent_protocol/src/model.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ pub struct AdHocCommand<S, T> {
155155
}
156156

157157
impl<S, T> AdHocCommand<S, T> {
158-
/// #Arguments
159-
/// * `address` - The target lane for the the command.
158+
/// # Arguments
159+
/// * `address` - The target lane for the command.
160160
/// * `command` - The body of the command message.
161161
/// * `overwrite_permitted` - Controls the behaviour of command handling in the case of back-pressure.
162162
/// If this is true, the command maybe be overwritten by a subsequent command to the same target (and so

api/swimos_api/src/agent/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ pub trait AgentContext: Sync {
196196
fn ad_hoc_commands(&self) -> BoxFuture<'static, Result<ByteWriter, DownlinkRuntimeError>>;
197197

198198
/// Add a new lane endpoint to the runtime for this agent.
199-
/// #Arguments
199+
/// # Arguments
200200
/// * `name` - The name of the lane.
201201
/// * `land_kind` - Kind of the lane, determining the protocol that the runtime uses
202202
/// to communicate with the lane.
@@ -214,7 +214,7 @@ pub trait AgentContext: Sync {
214214
) -> BoxFuture<'static, Result<HttpLaneRequestChannel, AgentRuntimeError>>;
215215

216216
/// Open a downlink to a lane on another agent.
217-
/// #Arguments
217+
/// # Arguments
218218
/// * `config` - The configuration for the downlink.
219219
/// * `host` - The host containing the node.
220220
/// * `node` - The node URI for the agent.
@@ -228,7 +228,7 @@ pub trait AgentContext: Sync {
228228
) -> BoxFuture<'static, Result<(ByteWriter, ByteReader), DownlinkRuntimeError>>;
229229

230230
/// Add a new named store that will persist a (possibly compound) value in the agent state.
231-
/// #Arguments
231+
/// # Arguments
232232
/// * `name` - The name of the store.
233233
/// * `kind` - The kind of the store.
234234
fn add_store(
@@ -270,7 +270,7 @@ pub type AgentInitResult = Result<AgentTask, AgentInitError>;
270270
pub trait Agent {
271271
/// Running an agent results in future that will perform the initialization of the agent and
272272
/// then yield another future that will actually run the agent.
273-
/// #Arguments
273+
/// # Arguments
274274
/// * `route` - The node URI of this agent instance.
275275
/// * `route_params` - Parameters extracted from the route URI.
276276
/// * `config` - Configuration parameters for the agent.

api/swimos_client_api/src/downlink/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub trait Downlink {
5858
/// Create a task that will manage the state of the downlink and service anything that is
5959
/// observing it/ pushing data to it.
6060
///
61-
/// #Arguments
61+
/// # Arguments
6262
/// * `path` - The path to the lane to which the downlink should be attached.
6363
/// * `config` - Configuration parameters for the downlink task.
6464
/// * `input` - Byte channel on which updates will be received from the runtime.

api/swimos_form/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
//! [`std::collections::HashMap`].
2121
//!
2222
//! A derivation macro is provided that can automatically generate implementations for straightforward
23-
//! struct and enum types. For instructions on how to use this, see the the [`Form`] trait or the SwimOS
23+
//! struct and enum types. For instructions on how to use this, see the [`Form`] trait or the SwimOS
2424
//! documentation.
2525
2626
#![allow(clippy::match_wild_err_arm)]

api/swimos_form/src/structural/generic/coproduct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl Coproduct for CNil {
4545
}
4646

4747
/// A non-empty coproduct. In general, we should have `T: Coproduct`, however, this makes it
48-
/// impossible to implement traits for general co-products due the the potentially unbounded
48+
/// impossible to implement traits for general co-products due potentially unbounded
4949
/// recursion.
5050
pub enum CCons<H, T> {
5151
Head(H),

api/swimos_form/src/structural/generic/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl<T, S: AppendHeaders> HeaderWithBody<T, S> {
139139
}
140140

141141
/// This trait allows all of the types in this crate to be used with a unified interface
142-
/// in the the macro-derived implementations.
142+
/// in the macro-derived implementations.
143143
pub trait AppendHeaders {
144144
/// The number of items that will be written into the attribute body.
145145
fn num_items(&self) -> usize;

api/swimos_form/src/structural/read/recognizer/mod.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ pub struct NamedFieldsRecognizer<T, Flds> {
262262
impl<T, Flds> NamedFieldsRecognizer<T, Flds> {
263263
/// Configure a recognizer.
264264
///
265-
/// #Arguments
265+
/// # Arguments
266266
///
267267
/// * `fields` - The state for the state machine.
268268
/// * `select_index` - Map the field names of the type to integer indicies.
@@ -293,7 +293,7 @@ impl<T, Flds> NamedFieldsRecognizer<T, Flds> {
293293

294294
/// Configure a recognizer for the type unpacked into an attribute body.
295295
///
296-
/// #Arguments
296+
/// # Arguments
297297
///
298298
/// * `fields` - The state for the state machine.
299299
/// * `select_index` - Map the field names of the type to integer indicies.
@@ -431,7 +431,7 @@ pub struct OrdinalFieldsRecognizer<T, Flds> {
431431
impl<T, Flds> OrdinalFieldsRecognizer<T, Flds> {
432432
/// Configure a recognizer.
433433
///
434-
/// #Arguments
434+
/// # Arguments
435435
///
436436
/// * `fields` - The state for the state machine.
437437
/// * `num_fields` - The total number of named fields in the representation.
@@ -459,7 +459,7 @@ impl<T, Flds> OrdinalFieldsRecognizer<T, Flds> {
459459

460460
/// Configure a recognizer for the type unpacked into an attribute body.
461461
///
462-
/// #Arguments
462+
/// # Arguments
463463
///
464464
/// * `fields` - The state for the state machine.
465465
/// * `num_fields` - The total number of named fields in the representation.
@@ -804,7 +804,7 @@ impl<T, Flds> OrdinalVTable<T, Flds> {
804804
}
805805

806806
impl<T, Flds> LabelledStructRecognizer<T, Flds> {
807-
/// #Arguments
807+
/// # Arguments
808808
/// * `tag` - The expected name of the first attribute or an inidcation that it should be used
809809
/// to populate a field.
810810
/// * `fields` - The state of the recognizer state machine (specified by the macro).
@@ -831,7 +831,7 @@ impl<T, Flds> LabelledStructRecognizer<T, Flds> {
831831
/// of the record has already been read before this recognizers is called so the initial state
832832
/// is skipped.
833833
///
834-
/// #Arguments
834+
/// # Arguments
835835
/// * `fields` - The state of the recognizer state machine (specified by the macro).
836836
/// * `num_fields` - The total numer of (non-skipped) fields that the recognizer expects.
837837
/// * `vtable` - Functions that are generated by the macro that determine how incoming events
@@ -854,7 +854,7 @@ impl<T, Flds> LabelledStructRecognizer<T, Flds> {
854854
}
855855

856856
impl<T, Flds> OrdinalStructRecognizer<T, Flds> {
857-
/// #Arguments
857+
/// # Arguments
858858
/// * `tag` - The expected name of the first attribute or an inidcation that it should be used
859859
/// to populate a field.
860860
/// * `fields` - The state of the recognizer state machine (specified by the macro).
@@ -881,7 +881,7 @@ impl<T, Flds> OrdinalStructRecognizer<T, Flds> {
881881
/// of the record has already been read before this recognizers is called so the initial state
882882
/// is skipped.
883883
///
884-
/// #Arguments
884+
/// # Arguments
885885
/// * `fields` - The state of the recognizer state machine (specified by the macro).
886886
/// * `num_fields` - The total numer of (non-skipped) fields that the recognizer expects.
887887
/// * `vtable` - Functions that are generated by the macro that determine how incoming events
@@ -1453,7 +1453,7 @@ pub struct DelegateStructRecognizer<T, Flds> {
14531453
}
14541454

14551455
impl<T, Flds> DelegateStructRecognizer<T, Flds> {
1456-
/// #Arguments
1456+
/// # Arguments
14571457
/// * `tag` - The expected name of the first attribute or an inidcation that it should be used
14581458
/// to populate a field.
14591459
/// * `fields` - The state of the recognizer state machine (specified by the macro).
@@ -1483,7 +1483,7 @@ impl<T, Flds> DelegateStructRecognizer<T, Flds> {
14831483
/// of the record has already been read before this recognizers is called so the initial state
14841484
/// is skipped.
14851485
///
1486-
/// #Arguments
1486+
/// # Arguments
14871487
/// * `fields` - The state of the recognizer state machine (specified by the macro).
14881488
/// * `num_fields` - The total numer of (non-skipped) fields that the recognizer expects.
14891489
/// * `vtable` - Functions that are generated by the macro that determine how incoming events
@@ -1702,7 +1702,7 @@ pub struct TaggedEnumRecognizer<Var> {
17021702
}
17031703

17041704
impl<Var> TaggedEnumRecognizer<Var> {
1705-
/// #Arguments
1705+
/// # Arguments
17061706
/// * `select_var` - A function that configures the wrapped recognizer to expect the
17071707
/// representation of the appropriate variant, based on the name of the tag attribute.
17081708
pub fn new(select_var: fn(&str) -> Option<Var>) -> Self {
@@ -1765,7 +1765,7 @@ pub struct UnitStructRecognizer<T> {
17651765
}
17661766

17671767
impl<T> UnitStructRecognizer<T> {
1768-
/// #Arguments
1768+
/// # Arguments
17691769
/// * `tag` - The expected name of the tag attribute.
17701770
/// * `on_done` - Factory to create an instance.
17711771
pub fn new(tag: &'static str, on_done: fn() -> T) -> Self {
@@ -1777,7 +1777,7 @@ impl<T> UnitStructRecognizer<T> {
17771777
}
17781778

17791779
/// For an enum variant, the wrapping [`Recognizer`] will already have read the tag name.
1780-
/// #Arguments
1780+
/// # Arguments
17811781
/// * `on_done` - Factory to create an instance.
17821782
pub fn variant(on_done: fn() -> T) -> Self {
17831783
UnitStructRecognizer {
@@ -1974,7 +1974,7 @@ pub struct HeaderRecognizer<T, Flds> {
19741974

19751975
/// Create a recognizer for the body of the header attribute of a record.
19761976
///
1977-
/// #Arguments
1977+
/// # Arguments
19781978
/// * `has_body` - Whether there is a field lifted to be the body of the header.
19791979
/// * `make_fields` - Factory to construct the state of the recognizer.
19801980
/// * `num_slots` - The number of slots lifted into the header.
@@ -1995,7 +1995,7 @@ where
19951995
FirstOf::new(simple, flattened)
19961996
}
19971997

1998-
/// #Arguments
1998+
/// # Arguments
19991999
/// * `has_body` - Whehter there is a field lifted to be the body of the header.
20002000
/// * `flattened` - Whether the record containing the fields has been flattened into the attribute
20012001
/// body (and so does not have explicit record body delimiting).

api/swimos_form/src/structural/write/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ pub trait HeaderWriter: Sized {
148148
type Body: BodyWriter;
149149

150150
/// Write an attribute into the header.
151-
/// #Arguments
151+
/// # Arguments
152152
/// * `name` - The name of the attribute.
153153
/// * `value` - The value whose structure will be used for the value of the attribute.
154154
fn write_attr<V: StructuralWritable>(
@@ -159,18 +159,18 @@ pub trait HeaderWriter: Sized {
159159

160160
/// Delegate the remainder of the process to another value (its attributes will be appended
161161
/// to those already described).
162-
/// #Arguments
162+
/// # Arguments
163163
/// * `value` - The value whose structure will be used for the remainder of the process.
164164
fn delegate<V: StructuralWritable>(self, value: &V) -> Result<Self::Repr, Self::Error>;
165165

166166
/// Delegate the remainder of the process to another value (its attributes will be appended
167167
/// to those already described), consuming it.
168-
/// #Arguments
168+
/// # Arguments
169169
/// * `value` - The value whose structure will be used for the remainder of the process.
170170
fn delegate_into<V: StructuralWritable>(self, value: V) -> Result<Self::Repr, Self::Error>;
171171

172172
/// Write an attribute into the header, consuming the value.
173-
/// #Arguments
173+
/// # Arguments
174174
/// * `name` - The name of the attribute.
175175
/// * `value` - The value whose structure will be used for the value of the attribute.
176176
fn write_attr_into<L: Label, V: StructuralWritable>(
@@ -214,7 +214,7 @@ pub trait HeaderWriter: Sized {
214214
}
215215
/// Transform this writer into another which can be used to describe the items.
216216
///
217-
/// #Arguments
217+
/// # Arguments
218218
/// * `kind` - Description of the contents of the body. If an incorrect value is provided,
219219
/// implementations may return an error but should not panic.
220220
/// * `num_items` - The number of items in the record. If an incorrect number is provided,

api/swimos_model/src/value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl Display for ValueKind {
191191
}
192192

193193
impl Value {
194-
/// Checks if the a [`Value`] is coercible into the [`ValueKind`] provided.
194+
/// Checks if the [`Value`] is coercible into the [`ValueKind`] provided.
195195
pub fn is_coercible_to(&self, kind: ValueKind) -> bool {
196196
match &self {
197197
Value::Int32Value(n) => match &kind {

0 commit comments

Comments
 (0)