Skip to content

Commit

Permalink
Document values of Continue and Break
Browse files Browse the repository at this point in the history
Users who are used to developing against other bindings might find
useful to have in the documentation to which values each enum maps to.
  • Loading branch information
A6GibKm committed Mar 24, 2024
1 parent c73784d commit d65299e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions glib/src/control_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ use crate::{prelude::*, translate::*};
/// `ControlFlow::Continue` keeps the closure assigned, to be rerun when appropriate.
///
/// `ControlFlow::Break` disconnects and drops it.
///
/// `Continue` and `Break` map to `G_SOURCE_CONTINUE` (`true`) and
/// `G_SOURCE_REMOVE` (`false`), respectively.
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum ControlFlow {
#[doc(alias = "G_SOURCE_CONTINUE")]
Continue,
#[doc(alias = "G_SOURCE_REMOVE")]
Break,
}

Expand Down
5 changes: 5 additions & 0 deletions glib/src/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,16 @@ pub fn signal_has_handler_pending<T: ObjectType>(

// rustdoc-stripper-ignore-next
/// Whether to invoke the other event handlers.
///
/// `Stop` and `Proceed` map to `GDK_EVENT_STOP` (`true`) and
/// `GDK_EVENT_PROPAGATE` (`false`), respectively.
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum Propagation {
// Stop other handlers from being invoked for the event.
#[doc(alias = "GDK_EVENT_STOP")]
Stop,
// Propagate the event further.
#[doc(alias = "GDK_EVENT_PROPAGATE")]
Proceed,
}

Expand Down

0 comments on commit d65299e

Please sign in to comment.