Skip to content

Commit

Permalink
Minor doc improvements (#1564)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr authored Feb 24, 2022
1 parent 4ede491 commit 031369d
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion crates/libs/windows/src/core/error.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::*;
use bindings::*;

/// A WinRT error object consists of both an error code as well as detailed error information for debugging.
/// An error object consists of both an error code as well as detailed error information for debugging.
#[derive(Clone, PartialEq)]
pub struct Error {
code: HRESULT,
Expand Down
2 changes: 1 addition & 1 deletion crates/libs/windows/src/core/guid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use super::*;
use bindings::*;

/// A globally unique identifier [(GUID)](https://docs.microsoft.com/en-us/windows/win32/api/guiddef/ns-guiddef-guid)
/// A globally unique identifier ([GUID](https://docs.microsoft.com/en-us/windows/win32/api/guiddef/ns-guiddef-guid))
/// used to identify COM and WinRT interfaces.
#[repr(C)]
// TODO: write these out
Expand Down
2 changes: 1 addition & 1 deletion crates/libs/windows/src/core/hresult.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::*;
use bindings::*;

/// A primitive error code value returned by most COM functions.
/// An error code value returned by most COM functions.
#[repr(transparent)]
#[derive(Copy, Clone, Default, Debug, Eq, PartialEq)]
#[must_use]
Expand Down
6 changes: 2 additions & 4 deletions crates/libs/windows/src/core/hstring.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use super::*;

// TODO: move to HSTRING generated code?

/// A WinRT string, sometimes called an [HSTRING](https://docs.microsoft.com/en-us/windows/win32/winrt/hstring),
/// is reference-counted and logically immutable. It should only be used for communicating with WinRT APIs.
/// A WinRT string ([HSTRING](https://docs.microsoft.com/en-us/windows/win32/winrt/hstring)),
/// is reference-counted and immutable.
#[repr(transparent)]
pub struct HSTRING(*mut Header);

Expand Down
1 change: 1 addition & 0 deletions crates/libs/windows/src/core/inspectable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ impl IInspectable {
}
}

#[doc(hidden)]
#[repr(C)]
pub struct IInspectableVtbl {
pub base: IUnknownVtbl,
Expand Down
5 changes: 3 additions & 2 deletions crates/libs/windows/src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ pub use guid::*;
pub use heap::*;
pub use hresult::*;
pub use hstring::*;
#[doc(hidden)]
pub use inspectable::*;
#[doc(hidden)]
pub use interface::*;
Expand Down Expand Up @@ -76,7 +75,7 @@ pub use weak::*;
#[doc(hidden)]
pub use weak_ref_count::*;

// A [`Result`] type that provides Windows error information.
/// A specialized [`Result`] type that provides Windows error information.
#[must_use]
pub type Result<T> = core::result::Result<T, Error>;

Expand All @@ -87,9 +86,11 @@ pub use bindings::IAgileObject;
#[doc(hidden)]
pub type RawPtr = *mut core::ffi::c_void;

#[doc(hidden)]
#[cfg(feature = "implement")]
pub use windows_implement::implement;

#[doc(hidden)]
#[cfg(feature = "interface")]
pub use windows_interface::interface;

Expand Down
1 change: 1 addition & 0 deletions crates/libs/windows/src/core/pcstr.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use super::*;

/// A pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters.
#[repr(transparent)]
pub struct PCSTR(pub *const u8);
impl PCSTR {
Expand Down
1 change: 1 addition & 0 deletions crates/libs/windows/src/core/pcwstr.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use super::*;

/// A pointer to a constant null-terminated string of 16-bit Unicode characters.
#[repr(transparent)]
pub struct PCWSTR(pub *const u16);
impl PCWSTR {
Expand Down
1 change: 1 addition & 0 deletions crates/libs/windows/src/core/pstr.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use super::*;

/// A pointer to a null-terminated string of 8-bit Windows (ANSI) characters.
#[repr(transparent)]
pub struct PSTR(pub *mut u8);
impl PSTR {
Expand Down
1 change: 1 addition & 0 deletions crates/libs/windows/src/core/pwstr.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use super::*;

/// A pointer to a null-terminated string of 16-bit Unicode characters.
#[repr(transparent)]
pub struct PWSTR(pub *mut u16);
impl PWSTR {
Expand Down
1 change: 1 addition & 0 deletions crates/libs/windows/src/core/unknown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ impl core::fmt::Debug for IUnknown {
}
}

#[doc(hidden)]
pub trait IUnknownImpl {
fn get_impl(&mut self) -> RawPtr;

Expand Down

0 comments on commit 031369d

Please sign in to comment.