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

Add api docs #12

Merged
merged 1 commit into from
Jan 23, 2025
Merged

Add api docs #12

merged 1 commit into from
Jan 23, 2025

Conversation

marshallpierce
Copy link
Contributor

  • Not including docs for every field -- I think it's reasonable for users to refer to the linked upstream docs for that.
  • Renamed commands to elements as it seemed a little closer to their nature, and the upstream docs use that term in a few places.
  • Removed data::DataSources and friends, as it didn't seem to be adding much

/// use rrd::data::Data;
/// use rrd::Timestamp;
///
/// let data = Data::new(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think users should be creating Data, which makes this example inapplicable

pub fn rows(&self) -> Rows<T> {
Rows { data: self }
}
}

pub struct DataSources<'data, T>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to come up with documentation explaining what this type does, and couldn't really find a reason why it wasn't just a slice of strings.

pub mod data;
pub mod error;
pub mod ops;
pub mod util;

pub use ops::fetch::fetch;
pub use ops::info::info;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seemed weird to leave pub use for only these two operations

- Not including docs for every field -- I think it's reasonable for
  users to refer to the linked upstream docs for that.
- Renamed `commands` to `elements` as it seemed a little closer to their
  nature, and the upstream docs use that term in a few places.
- Removed data::DataSources and friends, as it didn't seem to be adding
  much
@marshallpierce marshallpierce marked this pull request as ready for review January 23, 2025 00:56
@cygnus9 cygnus9 merged commit c8398f8 into cygnus9:main Jan 23, 2025
9 checks passed
@cygnus9
Copy link
Owner

cygnus9 commented Jan 23, 2025

Thanks a lot for all the PR's, it's very much appreciated. I'll be making a 0.2.0 release later this week, hopefully later today really. I was planning to add you to the authors section if you don't mind. I think you wrote the majority of the code by now. :)

Let me know if your good with that.

@marshallpierce
Copy link
Contributor Author

Thanks for being such a prompt collaborator :) I'd be happy to be an author -- might as well put this librrd knowledge to good use now that I've got it!

@cygnus9
Copy link
Owner

cygnus9 commented Jan 25, 2025

So I added you to the authers section and expected you to show up somewhere on crates.io. But that doesn't seem to work. Should I do something extra?

@marshallpierce
Copy link
Contributor Author

cargo owner --add marshallpierce looks like what crates.io is waiting for: https://doc.rust-lang.org/cargo/commands/cargo-owner.html

@marshallpierce
Copy link
Contributor Author

Invites received, thanks. Interestingly, the magic links inside worked even though that browser wasn't authenticated with crates.io at the time -- you'd think they would check the authenticated user == the invite recipient! Oh well, a problem for another day.

@cygnus9
Copy link
Owner

cygnus9 commented Jan 25, 2025

That is interesting. But oh well, our goal is achieved. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants