Correct several spelling errors

v5-api
Dominik Nakamura 3 years ago
parent dd5e942763
commit e0a718f9eb
No known key found for this signature in database
GPG Key ID: E4C6A749B2491910

@ -28,7 +28,7 @@ Add `obws` to your project with `cargo add obws` (needs [cargo-edit]) or add it
obws = { git = "https://github.com/dnaka91/obws.git", branch = "v5-api" } obws = { git = "https://github.com/dnaka91/obws.git", branch = "v5-api" }
``` ```
In addition, you will need to use the lastest [tokio](https://tokio.rs) runtime to use this library In addition, you will need to use the latest [tokio](https://tokio.rs) runtime to use this library
as it makes heavy use of async/await and is bound to this runtime. as it makes heavy use of async/await and is bound to this runtime.
[cargo-edit]: https://github.com/killercup/cargo-edit [cargo-edit]: https://github.com/killercup/cargo-edit

@ -63,7 +63,7 @@ enum InnerError {
/// functions to remote control an OBS instance as well as to listen to events caused by the user /// functions to remote control an OBS instance as well as to listen to events caused by the user
/// by interacting with OBS. /// by interacting with OBS.
pub struct Client { pub struct Client {
/// The writer handle to the websocket stream. /// The writer handle to the web-socket stream.
write: Mutex<MessageWriter>, write: Mutex<MessageWriter>,
/// Global counter for requests that help to find out what response belongs to what previously /// Global counter for requests that help to find out what response belongs to what previously
/// sent request. /// sent request.
@ -82,7 +82,7 @@ pub struct Client {
handle: Option<JoinHandle<()>>, handle: Option<JoinHandle<()>>,
} }
/// Shorthand for the writer side of a websocket stream that has been split into reader and writer. /// Shorthand for the writer side of a web-socket stream that has been split into reader and writer.
type MessageWriter = SplitSink<WebSocketStream<MaybeTlsStream<TcpStream>>, Message>; type MessageWriter = SplitSink<WebSocketStream<MaybeTlsStream<TcpStream>>, Message>;
/// Shorthand for the list of ongoing requests that wait for a response. /// Shorthand for the list of ongoing requests that wait for a response.
@ -98,7 +98,7 @@ where
H: AsRef<str>, H: AsRef<str>,
P: AsRef<str>, P: AsRef<str>,
{ {
/// The hostname, usually `localhost` unless the OBS instance is on a remote machine. /// The host name, usually `localhost` unless the OBS instance is on a remote machine.
pub host: H, pub host: H,
/// Port to connect to. /// Port to connect to.
pub port: u16, pub port: u16,
@ -426,7 +426,7 @@ impl Drop for Client {
} }
} }
/// Errors that can occur while performaning the initial handshake with obs-websocket. /// Errors that can occur while performing the initial handshake with obs-websocket.
#[derive(Debug, thiserror::Error)] #[derive(Debug, thiserror::Error)]
pub enum HandshakeError { pub enum HandshakeError {
/// The connection to obs-websocket was interrupted while trying to read a message. /// The connection to obs-websocket was interrupted while trying to read a message.
@ -435,7 +435,7 @@ pub enum HandshakeError {
/// Receiving a message did not succeed. /// Receiving a message did not succeed.
#[error("failed reading websocket message")] #[error("failed reading websocket message")]
Receive(#[source] tokio_tungstenite::tungstenite::Error), Receive(#[source] tokio_tungstenite::tungstenite::Error),
/// The WebSocket message was not convertible to text. /// The web-socket message was not convertible to text.
#[error("websocket message not convertible to text")] #[error("websocket message not convertible to text")]
IntoText(#[source] tokio_tungstenite::tungstenite::Error), IntoText(#[source] tokio_tungstenite::tungstenite::Error),
/// A message from obs-websocket could not be deserialized. /// A message from obs-websocket could not be deserialized.

@ -221,9 +221,9 @@ pub enum Event {
// -------------------------------- // --------------------------------
// Custom // Custom
// -------------------------------- // --------------------------------
/// WebSocket server is stopping. /// Web-socket server is stopping.
ServerStopping, ServerStopping,
/// WebSocket server has stopped. /// Web-socket server has stopped.
ServerStopped, ServerStopped,
/// Fallback value for any unknown event type. /// Fallback value for any unknown event type.
#[serde(other)] #[serde(other)]

@ -1,4 +1,4 @@
//! # OBSWS - The obws (obvious) remote control library for OBS //! # OBWS - The obws (obvious) remote control library for OBS
//! //!
//! Remote control OBS with the [obs-websocket] plugin from Rust 🦀. //! Remote control OBS with the [obs-websocket] plugin from Rust 🦀.
//! //!
@ -49,16 +49,16 @@ pub type Result<T, E = Error> = std::result::Result<T, E>;
/// Errors that can occur while using this crate. /// Errors that can occur while using this crate.
#[derive(Debug, thiserror::Error)] #[derive(Debug, thiserror::Error)]
pub enum Error { pub enum Error {
/// An error occurred while trying to connect to the websocket. /// An error occurred while trying to connect to the web-socket.
#[error("failed to connect to the obs-websocket plugin")] #[error("failed to connect to the obs-websocket plugin")]
Connect(#[source] tokio_tungstenite::tungstenite::Error), Connect(#[source] tokio_tungstenite::tungstenite::Error),
/// The initial handshake with `obs-websocket` didn't succeed. /// The initial handshake with `obs-websocket` didn't succeed.
#[error("failed to execute the handshake with obs-websocket")] #[error("failed to execute the handshake with obs-websocket")]
Handshake(#[from] crate::client::HandshakeError), Handshake(#[from] crate::client::HandshakeError),
/// Failed to serialize the message to be send to the websocket. /// Failed to serialize the message to be send to the web-socket.
#[error("failed to serialize message")] #[error("failed to serialize message")]
SerializeMessage(#[source] serde_json::Error), SerializeMessage(#[source] serde_json::Error),
/// A message could not be send through the websocket. /// A message could not be send through the web-socket.
#[error("failed to send message to the obs-websocket plugin")] #[error("failed to send message to the obs-websocket plugin")]
Send(#[source] tokio_tungstenite::tungstenite::Error), Send(#[source] tokio_tungstenite::tungstenite::Error),
/// Tried to receive data while the send side was already closed. /// Tried to receive data while the send side was already closed.

@ -8,12 +8,13 @@ use serde_repr::Deserialize_repr;
#[derive(Debug)] #[derive(Debug)]
pub(crate) enum ServerMessage { pub(crate) enum ServerMessage {
/// First message sent from the server immediately on client connection. Contains authentication /// First message sent from the server immediately on client connection. Contains authentication
/// information if auth is required. Also contains RPC version for version negotiation. /// information if it is required. Also contains RPC (remote procedure call) version for
/// version negotiation.
Hello(Hello), Hello(Hello),
/// The identify request was received and validated, and the connection is now ready for normal /// The identify request was received and validated, and the connection is now ready for normal
/// operation. /// operation.
Identified(Identified), Identified(Identified),
/// An event coming from OBS has occurred. Eg scene switched, source muted. /// An event coming from OBS has occurred. For example scene switched, source muted.
#[cfg(feature = "events")] #[cfg(feature = "events")]
Event(crate::events::Event), Event(crate::events::Event),
#[cfg(not(feature = "events"))] #[cfg(not(feature = "events"))]
@ -90,7 +91,7 @@ pub(crate) struct Hello {
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub(crate) struct Identified { pub(crate) struct Identified {
/// The RPC version to be used. /// The RPC (remote procedure call) version to be used.
pub negotiated_rpc_version: u32, pub negotiated_rpc_version: u32,
} }
@ -138,7 +139,7 @@ pub enum StatusCode {
GenericError = 205, GenericError = 205,
/// A required request parameter is missing. /// A required request parameter is missing.
MissingRequestParameter = 300, MissingRequestParameter = 300,
/// The request does not have a valid requestData object. /// The request does not have a valid `requestData` object.
MissingRequestData = 301, MissingRequestData = 301,
/// Generic invalid request parameter message. /// Generic invalid request parameter message.
InvalidRequestParameter = 400, InvalidRequestParameter = 400,
@ -172,54 +173,56 @@ pub enum StatusCode {
StudioModeActive = 510, StudioModeActive = 510,
/// Studio mode is not active and should be. /// Studio mode is not active and should be.
StudioModeNotActive = 511, StudioModeNotActive = 511,
/// Virtualcam is running and cannot be. /// Virtual-cam is running and cannot be.
VirtualCamRunning = 512, VirtualCamRunning = 512,
/// Virtualcam is not running and should be. /// Virtual-cam is not running and should be.
VirtualCamNotRunning = 513, VirtualCamNotRunning = 513,
/// The specified source (obs_source_t) was of the invalid type (Eg. input instead of scene). /// The specified source (`obs_source_t`) was of the invalid type (for example input instead of
/// scene).
InvalidSourceType = 600, InvalidSourceType = 600,
/// The specified source (obs_source_t) was not found (generic for input, filter, transition, /// The specified source (`obs_source_t`) was not found (generic for input, filter, transition,
/// scene). /// scene).
SourceNotFound = 601, SourceNotFound = 601,
/// The specified source (obs_source_t) already exists. Applicable to inputs, filters, /// The specified source (`obs_source_t`) already exists. Applicable to inputs, filters,
/// transitions, scenes. /// transitions, scenes.
SourceAlreadyExists = 602, SourceAlreadyExists = 602,
/// The specified input (obs_source_t-OBS_SOURCE_TYPE_FILTER) was not found. /// The specified input (`obs_source_t-OBS_SOURCE_TYPE_FILTER`) was not found.
InputNotFound = 603, InputNotFound = 603,
/// The specified input (obs_source_t-OBS_SOURCE_TYPE_INPUT) had the wrong kind. /// The specified input (`obs_source_t-OBS_SOURCE_TYPE_INPUT`) had the wrong kind.
InvalidInputKind = 604, InvalidInputKind = 604,
/// The specified filter (obs_source_t-OBS_SOURCE_TYPE_FILTER) was not found. /// The specified filter (`obs_source_t-OBS_SOURCE_TYPE_FILTER`) was not found.
FilterNotFound = 605, FilterNotFound = 605,
/// The specified transition (obs_source_t-OBS_SOURCE_TYPE_TRANSITION) was not found. /// The specified transition (`obs_source_t-OBS_SOURCE_TYPE_TRANSITION`) was not found.
TransitionNotFound = 606, TransitionNotFound = 606,
/// The specified transition (obs_source_t-OBS_SOURCE_TYPE_TRANSITION) does not support setting /// The specified transition (`obs_source_t-OBS_SOURCE_TYPE_TRANSITION`) does not support
/// its position (transition is of fixed type). /// setting its position (transition is of fixed type).
TransitionDurationFixed = 607, TransitionDurationFixed = 607,
/// The specified scene (obs_source_t-OBS_SOURCE_TYPE_SCENE), (obs_scene_t) was not found. /// The specified scene (`obs_source_t-OBS_SOURCE_TYPE_SCENE`), (`obs_scene_t`) was not found.
SceneNotFound = 608, SceneNotFound = 608,
/// The specified scene item (obs_sceneitem_t) was not found. /// The specified scene item (`obs_sceneitem_t`) was not found.
SceneItemNotFound = 609, SceneItemNotFound = 609,
/// The specified scene collection was not found. /// The specified scene collection was not found.
SceneCollectionNotFound = 610, SceneCollectionNotFound = 610,
/// The specified profile was not found. /// The specified profile was not found.
ProfileNotFound = 611, ProfileNotFound = 611,
/// The specified output (obs_output_t) was not found. /// The specified output (`obs_output_t`) was not found.
OutputNotFound = 612, OutputNotFound = 612,
/// The specified encoder (obs_encoder_t) was not found. /// The specified encoder (`obs_encoder_t`) was not found.
EncoderNotFound = 613, EncoderNotFound = 613,
/// The specified service (obs_service_t) was not found. /// The specified service (`obs_service_t`) was not found.
ServiceNotFound = 614, ServiceNotFound = 614,
/// The specified hotkey was not found. /// The specified hotkey was not found.
HotkeyNotFound = 615, HotkeyNotFound = 615,
/// The specified directory was not found. /// The specified directory was not found.
DirectoryNotFound = 616, DirectoryNotFound = 616,
/// The specified config item (config_t) was not found. Could be section or parameter name. /// The specified configuration item (`config_t`) was not found. Could be section or parameter
/// name.
ConfigParameterNotFound = 617, ConfigParameterNotFound = 617,
/// The specified property (obs_properties_t) was not found. /// The specified property (`obs_properties_t`) was not found.
PropertyNotFound = 618, PropertyNotFound = 618,
/// The specififed key (OBS_KEY_*) was not found. /// The specified key (`OBS_KEY_*`) was not found.
KeyNotFound = 619, KeyNotFound = 619,
/// The specified data realm (OBS_WEBSOCKET_DATA_REALM_*) was not found. /// The specified data realm (`OBS_WEBSOCKET_DATA_REALM_*`) was not found.
DataRealmNotFound = 620, DataRealmNotFound = 620,
/// The scene collection already exists. /// The scene collection already exists.
SceneCollectionAlreadyExists = 621, SceneCollectionAlreadyExists = 621,

Loading…
Cancel
Save