repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/src/widget/either.rs
druid/src/widget/either.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! A widget that switches dynamically between two child views. use crate::debug_state::DebugState; use crate::widget::prelude::*; use crate::{Data, Point, WidgetPod}; use tracing::instrument; /// A widget that switches between two possible c...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/src/widget/scope.rs
druid/src/widget/scope.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 use std::marker::PhantomData; use crate::widget::prelude::*; use crate::widget::WidgetWrapper; use crate::{Data, Lens, Point, WidgetPod}; use tracing::instrument; /// A policy that controls how a [`Scope`] will interact with its surrounding /...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/src/widget/progress_bar.rs
druid/src/widget/progress_bar.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! A progress bar widget. use crate::debug_state::DebugState; use crate::widget::prelude::*; use crate::{theme, LinearGradient, Point, Rect, UnitPoint}; use tracing::instrument; /// A progress bar, displaying a numeric progress value. /// //...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/src/widget/align.rs
druid/src/widget/align.rs
// Copyright 2018 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! A widget that aligns its child (for example, centering it). use crate::debug_state::DebugState; use crate::widget::prelude::*; use crate::{Data, Rect, Size, UnitPoint, WidgetPod}; use tracing::{instrument, trace}; /// A widget that aligns...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/src/widget/intrinsic_width.rs
druid/src/widget/intrinsic_width.rs
// Copyright 2022 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! A widget that sizes its child to the child's maximum intrinsic width. use crate::widget::Axis; use crate::{ BoxConstraints, Data, Env, Event, EventCtx, LayoutCtx, LifeCycle, LifeCycleCtx, PaintCtx, Size, UpdateCtx, Widget, }; /// ...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/src/widget/mod.rs
druid/src/widget/mod.rs
// Copyright 2018 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! Common widgets. // First as it defines macros #[macro_use] mod widget_wrapper; mod added; mod align; mod aspect_ratio_box; mod button; mod checkbox; mod click; mod clip_box; mod common; mod container; mod controller; mod disable_if; mod e...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/src/widget/widget_wrapper.rs
druid/src/widget/widget_wrapper.rs
// Copyright 2021 the Druid Authors // SPDX-License-Identifier: Apache-2.0 /// A trait for widgets that wrap a single child to expose that child for access and mutation pub trait WidgetWrapper { /// The type of the wrapped widget. /// Maybe we would like to constrain this to `Widget<impl Data>` (if existential...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/src/widget/added.rs
druid/src/widget/added.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! A [`Controller`] widget that responds to [`LifeCycle::WidgetAdded`] event. //! //! [`Controller`]: crate::widget::Controller //! [`LifeCycle::WidgetAdded`]: crate::LifeCycle::WidgetAdded use crate::widget::Controller; use crate::{Data, Env...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/src/widget/radio.rs
druid/src/widget/radio.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! A radio button widget. use crate::debug_state::DebugState; use crate::kurbo::Circle; use crate::widget::prelude::*; use crate::widget::{Axis, CrossAxisAlignment, Flex, Label, LabelText}; use crate::{theme, Data, LinearGradient, UnitPoint};...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/src/widget/view_switcher.rs
druid/src/widget/view_switcher.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! A widget that can dynamically switch between one of many views. use crate::widget::prelude::*; use crate::{Data, Point, WidgetPod}; use tracing::instrument; type ChildPicker<T, U> = dyn Fn(&T, &Env) -> U; type ChildBuilder<T, U> = dyn Fn(...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/src/widget/checkbox.rs
druid/src/widget/checkbox.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! A checkbox widget. use crate::debug_state::DebugState; use crate::kurbo::{BezPath, Size}; use crate::piet::{LineCap, LineJoin, LinearGradient, RenderContext, StrokeStyle, UnitPoint}; use crate::theme; use crate::widget::{prelude::*, Label,...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/src/widget/common.rs
druid/src/widget/common.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 use crate::{Affine, Data, Size}; // These are based on https://api.flutter.dev/flutter/painting/BoxFit.html /// Strategies for inscribing a rectangle inside another rectangle. #[derive(Default, Clone, Data, Copy, PartialEq, Eq)] pub enum FillS...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/src/widget/maybe.rs
druid/src/widget/maybe.rs
// Copyright 2021 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! A widget for optional data, with different `Some` and `None` children. use crate::debug_state::DebugState; use druid::{ BoxConstraints, Data, Env, Event, EventCtx, LayoutCtx, LifeCycle, LifeCycleCtx, PaintCtx, Point, Size, UpdateC...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/src/widget/label.rs
druid/src/widget/label.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! A label widget. use std::ops::{Deref, DerefMut}; use std::sync::Arc; use druid_shell::Cursor; use crate::debug_state::DebugState; use crate::kurbo::Vec2; use crate::text::TextStorage; use crate::widget::prelude::*; use crate::widget::Axi...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/src/widget/spinner.rs
druid/src/widget/spinner.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! An animated spinner widget. use std::f64::consts::PI; use tracing::{instrument, trace}; use druid::kurbo::Line; use druid::widget::prelude::*; use druid::{theme, Color, Data, KeyOrValue, Point, Vec2}; /// An animated spinner widget for s...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/src/widget/disable_if.rs
druid/src/widget/disable_if.rs
// Copyright 2021 the Druid Authors // SPDX-License-Identifier: Apache-2.0 use crate::debug_state::DebugState; use crate::{ BoxConstraints, Data, Env, Event, EventCtx, LayoutCtx, LifeCycle, LifeCycleCtx, PaintCtx, Point, Size, UpdateCtx, Widget, WidgetPod, }; /// A widget wrapper which disables the child widg...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/src/widget/lens_wrap.rs
druid/src/widget/lens_wrap.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! A [`Widget`] that uses a [`Lens`] to change the [`Data`] of its child. use std::marker::PhantomData; use crate::debug_state::DebugState; use crate::widget::prelude::*; use crate::widget::WidgetWrapper; use crate::{Data, Lens}; use tracin...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/src/widget/switch.rs
druid/src/widget/switch.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! A toggle switch widget. use std::time::Duration; use tracing::{instrument, trace}; use crate::debug_state::DebugState; use crate::kurbo::{Circle, Shape}; use crate::piet::{LinearGradient, RenderContext, UnitPoint}; use crate::widget::prel...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/src/widget/padding.rs
druid/src/widget/padding.rs
// Copyright 2018 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! A widget that just adds padding during layout. use crate::debug_state::DebugState; use crate::widget::{prelude::*, Axis, WidgetWrapper}; use crate::{Data, Insets, KeyOrValue, Point, WidgetPod}; use tracing::{instrument, trace}; /// A wid...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/src/widget/split.rs
druid/src/widget/split.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! A widget which splits an area in two, with a settable ratio, and optional draggable resizing. use crate::debug_state::DebugState; use crate::kurbo::Line; use crate::widget::flex::Axis; use crate::widget::prelude::*; use crate::{theme, Colo...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/z_stack.rs
druid/examples/z_stack.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! A simple test of overlapping widgets. // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use druid::widget::prelude::*; use druid::widget::{Button, Label, ZStack}; use druid::{AppLauncher,...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/styled_text.rs
druid/examples/styled_text.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! Example of dynamic text styling // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] #[allow(deprecated)] use druid::widget::Parse; use druid::widget::{ Checkbox, CrossAxisAlignment, Fle...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/scroll.rs
druid/examples/scroll.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! Shows a scroll widget, and also demonstrates how widgets that paint //! outside their bounds can specify their paint region. // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use druid::k...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/flex.rs
druid/examples/flex.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! Demonstrates alignment of children in the flex container. //! This example showcases the full set of functionality of flex, giving you //! knobs to change all the parameters. 99% of the time you will want to //! hard-code these parameters, ...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/sub_window.rs
druid/examples/sub_window.rs
// Copyright 2021 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! Example of sub windows. // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use druid::commands::CLOSE_WINDOW; use druid::lens::Unit; use druid::widget::{ Align, Button, Checkbox, Contr...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/split_demo.rs
druid/examples/split_demo.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! This example demonstrates the `Split` widget // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use druid::piet::Color; use druid::widget::{Align, Container, Label, Padding, Split}; use dr...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/custom_widget.rs
druid/examples/custom_widget.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! An example of a custom drawing widget. //! We draw an image, some text, a shape, and a curve. // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use druid::kurbo::BezPath; use druid::piet:...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/cursor.rs
druid/examples/cursor.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! An example showing how to change the mouse cursor. //! Clicking the button should switch your cursor, and //! the last cursor should be a custom image. Custom //! image cursors cannot be created before the window is //! open so we have to w...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/markdown_preview.rs
druid/examples/markdown_preview.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! An example of live markdown preview // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use pulldown_cmark::{Event as ParseEvent, Options, Parser, Tag}; use druid::text::{AttributesAdder, ...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/tabs.rs
druid/examples/tabs.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! Example of tabs // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use druid::im::Vector; use druid::widget::{ Axis, Button, CrossAxisAlignment, Flex, Label, MainAxisAlignment, RadioGr...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/svg.rs
druid/examples/svg.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! This example shows how to draw an SVG. // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use tracing::error; use druid::{ widget::{Flex, Svg, SvgData, WidgetExt}, AppLauncher, Lo...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/calc.rs
druid/examples/calc.rs
// Copyright 2018 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! Simple calculator. // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use druid::{ theme, AppLauncher, Color, Data, Lens, LocalizedString, RenderContext, Widget, WidgetExt, WindowD...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/game_of_life.rs
druid/examples/game_of_life.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! This is an example of how you would implement the game of life with Druid. //! This example doesn't showcase anything specific in Druid. // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] ...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/textbox.rs
druid/examples/textbox.rs
// Copyright 2021 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! An example of various text layout features. //! //! I would like to make this a bit fancier (like the flex demo) but for now //! lets keep it simple. // On Windows platform, don't show a console when opening the app. #![windows_subsystem =...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/image.rs
druid/examples/image.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! This showcase demonstrates how to use the image widget and its //! properties. You can change the parameters in the GUI to see how //! everything behaves. // On Windows platform, don't show a console when opening the app. #![windows_subsys...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/invalidation.rs
druid/examples/invalidation.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! Demonstrates how to debug invalidation regions, and also shows the //! invalidation behavior of several built-in widgets. // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use druid::im::...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/list.rs
druid/examples/list.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! Demos basic list widget and list manipulations. // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use druid::im::{vector, Vector}; use druid::lens::{self, LensExt}; use druid::widget::{Bu...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/disabled.rs
druid/examples/disabled.rs
// Copyright 2021 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! An example showing the effect of the disabled state on focus-chain and the widgets. //! When the disabled checkbox is clicked only the widgets not marked as disabled should //! respond. Pressing Tab should only focus widgets not marked as d...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/slider.rs
druid/examples/slider.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! This is a demo of the settings of Slider, RangeSlider and Annotated. //! It contains a `Slider` and `RangeSlider`. //! Every time the `RangeSlider` is moved the range of the `Slider` is updated. // On Windows platform, don't show a console...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/text.rs
druid/examples/text.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! An example of various text layout features. // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use druid::piet::{PietTextLayoutBuilder, TextStorage as PietTextStorage}; use druid::text::{A...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/panels.rs
druid/examples/panels.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! This example shows how to construct a basic layout. // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use druid::kurbo::Circle; use druid::widget::{Flex, Label, Painter}; use druid::{ ...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/either.rs
druid/examples/either.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! An example using the Either widget to show/hide a slider. //! This is a very simple example, it uses a bool to determine //! which widget gets shown. // On Windows platform, don't show a console when opening the app. #![windows_subsystem =...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/hello.rs
druid/examples/hello.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! This is a very small example of how to setup a Druid application. //! It does the almost bare minimum while still being useful. // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use druid...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/transparency.rs
druid/examples/transparency.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! An example of a transparent window background. //! Useful for dropdowns, tooltips and other overlay windows. // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use druid::widget::prelude::...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/timer.rs
druid/examples/timer.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! An example of a timer. // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use std::time::Duration; use druid::widget::prelude::*; use druid::widget::BackgroundBrush; use druid::{AppLaunch...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/anim.rs
druid/examples/anim.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! An example of an animating widget. It is just a widget that //! requests an animation frame when it needs to, and draws the frame in the //! `paint` method. //! Once the animation is over it simply stops requesting animation frames. //! Usu...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/layout.rs
druid/examples/layout.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! This example shows how to construct a basic layout, //! using columns, rows, and loops, for repeated Widgets. // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use druid::widget::{AspectR...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/scroll_colors.rs
druid/examples/scroll_colors.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! This example allows to play with scroll bars over different color tones. // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use druid::widget::{Container, Flex, Scroll, SizedBox}; use drui...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/view_switcher.rs
druid/examples/view_switcher.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! This example demonstrates the `ViewSwitcher` widget // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use druid::widget::{Button, Flex, Label, Split, TextBox, ViewSwitcher}; use druid::{A...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/async_event.rs
druid/examples/async_event.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! An example of sending commands from another thread. //! This is useful when you want to have some kind of //! generated content (like here), or some task that just //! takes a long time but don't want to block the main thread //! (waiting o...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/input_region.rs
druid/examples/input_region.rs
// Copyright 2023 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! A demo of a few window features, including input region, always on top, //! and titlebar visibility. //! The demo is setup so that there are parts of the window that you can click through. //! There are also buttons for setting always on to...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/multiwin.rs
druid/examples/multiwin.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! Opening and closing windows and using window and context menus. // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use druid::widget::prelude::*; use druid::widget::{ Align, Background...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/widget_gallery.rs
druid/examples/widget_gallery.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! An example showcasing various widgets. // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use druid::{ im, kurbo::{Affine, BezPath, Circle, Point}, piet::{FixedLinearGradient, ...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/blocking_function.rs
druid/examples/blocking_function.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! An example of a blocking function running in another thread. We give //! the other thread some data and then we also pass some data back //! to the main thread using commands. // On Windows platform, don't show a console when opening the a...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/identity.rs
druid/examples/identity.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! An example of sending commands to specific widgets. //! //! This example is fairly contrived; the basic idea is that there are two counters, //! and two buttons. If you press button one, counter one goes up. If you press button //! two coun...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/event_viewer.rs
druid/examples/event_viewer.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! An application that accepts keyboard and mouse input, and displays //! information about received events. // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use druid::widget::prelude::*; ...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/lens.rs
druid/examples/lens.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! This example shows basic usage of Lens // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use druid::widget::Slider; use druid::widget::{CrossAxisAlignment, Flex, Label, TextBox}; use drui...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/open_save.rs
druid/examples/open_save.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! Usage of file open and saving. // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] use druid::widget::{Align, Button, Flex, TextBox}; use druid::{ commands, AppDelegate, AppLauncher, Co...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/switches.rs
druid/examples/switches.rs
// Copyright 2019 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! Example of switches // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] #[allow(deprecated)] use druid::widget::Parse; use druid::widget::{ Checkbox, Flex, Label, LensWrap, MainAxisAlig...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/value_formatting/src/formatters.rs
druid/examples/value_formatting/src/formatters.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! Implementations of the [`druid::text::Formatter`] trait. use druid::text::{Formatter, Selection, Validation, ValidationError}; use druid::Data; /// A formatter that can display currency values. pub struct NaiveCurrencyFormatter { curr...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/value_formatting/src/widgets.rs
druid/examples/value_formatting/src/widgets.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 //! Widgets, widget components, and functions for creating widgets use druid::text::ValidationError; use druid::widget::{ prelude::*, Controller, Either, Label, SizedBox, TextBoxEvent, ValidationDelegate, }; use druid::{Color, Data, Point,...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/value_formatting/src/main.rs
druid/examples/value_formatting/src/main.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] mod formatters; mod widgets; use druid::widget::{prelude::*, Flex, Label, TextBox}; use druid::{AppLauncher, Data, Lens, WidgetExt, WidgetId,...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/hello_web/src/lib.rs
druid/examples/hello_web/src/lib.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 use druid::widget::{Align, Flex, Label, TextBox}; use druid::{AppLauncher, Data, Env, Lens, Widget, WidgetExt, WindowDesc}; use wasm_bindgen::prelude::*; const VERTICAL_WIDGET_SPACING: f64 = 20.0; const TEXT_BOX_WIDTH: f64 = 200.0; #[derive(...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/web/build.rs
druid/examples/web/build.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 use std::io::{ErrorKind, Result}; use std::path::{Path, PathBuf}; use std::{env, fs}; /// Examples known to not work with the web backend are skipped. /// Ideally this list will eventually be empty. const EXCEPTIONS: &[&str] = &[ "markdown...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
linebender/druid
https://github.com/linebender/druid/blob/b27ea6a618c32f9ea0e8a56822f9487d23401c0d/druid/examples/web/src/lib.rs
druid/examples/web/src/lib.rs
// Copyright 2020 the Druid Authors // SPDX-License-Identifier: Apache-2.0 use wasm_bindgen::prelude::*; // This line includes an automatically generated (in build.rs) examples module. // This particular mechanism is chosen to avoid any kinds of modifications to committed files at // build time, keeping the source tr...
rust
Apache-2.0
b27ea6a618c32f9ea0e8a56822f9487d23401c0d
2026-01-04T15:44:39.941670Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/build.rs
build.rs
#[cfg(windows)] extern crate winres; use std::borrow::Cow; use std::env; use std::fs::File; use std::io::{BufRead, BufReader, BufWriter, Write}; use std::path::Path; include!("./src/networking/types/service_query.rs"); include!("./src/networking/types/protocol.rs"); const WINDOWS_ICON_PATH: &str = "./resources/packa...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/main.rs
src/main.rs
//! Module containing the entry point of application execution. #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] use std::borrow::Cow; use chart::types::traffic_chart::TrafficChart; use cli::handle_cli_args; use gui::pages::types::running_page::RunningPage; use gui::sniffer::Sniffer; use gui::style...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/mmdb/country.rs
src/mmdb/country.rs
use crate::countries::types::country::Country; use crate::mmdb::types::mmdb_country_entry::MmdbCountryEntry; use crate::mmdb::types::mmdb_reader::MmdbReader; use std::net::IpAddr; pub const COUNTRY_MMDB: &[u8] = include_bytes!("../../resources/DB/GeoLite2-Country.mmdb"); #[allow(clippy::module_name_repetitions)] pub ...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/mmdb/mod.rs
src/mmdb/mod.rs
pub mod asn; pub mod country; pub mod types;
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/mmdb/asn.rs
src/mmdb/asn.rs
use crate::mmdb::types::mmdb_asn_entry::MmdbAsnEntry; use crate::mmdb::types::mmdb_reader::MmdbReader; use crate::networking::types::asn::Asn; use std::net::IpAddr; pub const ASN_MMDB: &[u8] = include_bytes!("../../resources/DB/GeoLite2-ASN.mmdb"); #[allow(clippy::module_name_repetitions)] pub fn get_asn(address: &Ip...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/mmdb/types/mmdb_asn_entry.rs
src/mmdb/types/mmdb_asn_entry.rs
use serde::Deserialize; use crate::networking::types::asn::Asn; #[derive(Deserialize)] pub struct MmdbAsnEntry<'a> { #[serde(alias = "autonomous_system_number", alias = "asn")] code: MmdbAsnCode<'a>, #[serde(alias = "autonomous_system_organization", alias = "as_name")] name: Option<&'a str>, } impl M...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/mmdb/types/mmdb_country_entry.rs
src/mmdb/types/mmdb_country_entry.rs
use serde::Deserialize; use crate::countries::types::country::Country; #[derive(Deserialize)] #[serde(transparent)] pub struct MmdbCountryEntry<'a> { #[serde(borrow)] inner: MmdbCountryEntryInner<'a>, } impl MmdbCountryEntry<'_> { pub fn get_country(&self) -> Country { self.inner.get_country() ...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/mmdb/types/mmdb_reader.rs
src/mmdb/types/mmdb_reader.rs
use std::net::IpAddr; use std::sync::Arc; use crate::location; use crate::utils::error_logger::{ErrorLogger, Location}; use maxminddb::Reader; use serde::Deserialize; #[derive(Clone)] pub struct MmdbReaders { pub country: Arc<MmdbReader>, pub asn: Arc<MmdbReader>, } pub enum MmdbReader { Default(Reader<&...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/mmdb/types/mod.rs
src/mmdb/types/mod.rs
pub mod mmdb_asn_entry; pub mod mmdb_country_entry; pub mod mmdb_reader;
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/translations/translations.rs
src/translations/translations.rs
// EXTRA NEEDED CHARACTERS: Б use iced::widget::Text; use crate::StyleType; use crate::translations::types::language::Language; // pub fn choose_adapters_translation<'a>(language: Language) -> Text<'a, StyleType> { // Text::new(match language { // Language::EN => "Select network adapter to inspect", // ...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
true
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/translations/translations_3.rs
src/translations/translations_3.rs
#![allow(clippy::match_same_arms, clippy::match_wildcard_for_single_variants)] use crate::Language; // This is referred to settings (General settings) pub fn general_translation(language: Language) -> &'static str { match language { Language::EN | Language::RO => "General", Language::CS => "Hlavní...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/translations/translations_2.rs
src/translations/translations_2.rs
use crate::Language; pub fn new_version_available_translation(language: Language) -> &'static str { match language { Language::EN => "A newer version is available!", Language::CS => "Je k dispozici novější verze!", Language::IT => "Una versione più recente è disponibile!", Language:...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
true
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/translations/mod.rs
src/translations/mod.rs
#![allow(clippy::module_inception, clippy::module_name_repetitions)] pub mod translations; pub mod translations_2; pub mod translations_3; pub mod translations_4; pub mod translations_5; pub mod types;
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/translations/translations_4.rs
src/translations/translations_4.rs
#![allow(clippy::match_same_arms)] use crate::translations::types::language::Language; pub fn reserved_address_translation(language: Language, info: &str) -> String { match language { Language::EN => format!("Reserved address ({info})"), Language::CS => format!("Rezervovaná adresa ({info})"), ...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/translations/translations_5.rs
src/translations/translations_5.rs
#![allow(clippy::match_same_arms)] use crate::translations::types::language::Language; pub fn filter_traffic_translation(language: Language) -> String { match language { Language::EN => "Filter traffic", Language::CS => "Filtr provozu", Language::IT => "Filtra il traffico", _ => "F...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/translations/types/language.rs
src/translations/types/language.rs
use std::fmt; use iced::widget::Svg; use iced::widget::svg::Handle; use serde::{Deserialize, Serialize}; use crate::StyleType; use crate::countries::flags_pictures::{ CN, CZ, DE, ES, FI, FLAGS_WIDTH_BIG, FR, GB, GR, ID, IT, JP, KR, NL, PL, PT, RO, RU, SE, TR, TW, UA, UZ, VN, }; /// This enum defines the avai...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/translations/types/mod.rs
src/translations/types/mod.rs
pub mod language;
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/utils/error_logger.rs
src/utils/error_logger.rs
use std::fmt::Display; /// Trait for logging errors in a unified way pub trait ErrorLogger<T, E> { /// Log the error and its location #[allow(clippy::missing_errors_doc)] fn log_err(self, loc: Location) -> Result<T, E>; } impl<T, E: Display> ErrorLogger<T, E> for Result<T, E> { fn log_err(self, locati...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/utils/mod.rs
src/utils/mod.rs
pub mod check_updates; pub mod error_logger; pub mod formatted_strings; pub mod types;
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/utils/check_updates.rs
src/utils/check_updates.rs
use crate::utils::error_logger::{ErrorLogger, Location}; use crate::utils::formatted_strings::APP_VERSION; use crate::{SNIFFNET_LOWERCASE, location}; use semver::Version; use serde::Deserialize; use std::time::Duration; #[derive(Deserialize, Debug)] struct AppVersion { name: String, } /// Calls a method to check ...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/utils/formatted_strings.rs
src/utils/formatted_strings.rs
use std::cmp::min; use std::net::IpAddr; use crate::utils::types::timestamp::Timestamp; use chrono::{Local, TimeZone}; /// Application version number (to be displayed in gui footer) pub const APP_VERSION: &str = env!("CARGO_PKG_VERSION"); // /// Computes the String representing the percentage of filtered bytes/packe...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/utils/types/icon.rs
src/utils/types/icon.rs
use iced::widget::Text; use crate::StyleType; use crate::gui::styles::style_constants::ICONS; pub enum Icon { ArrowBack, ArrowLeft, ArrowRight, ArrowsDown, AudioHigh, AudioMute, Bin, Book, BytesThreshold, Clock, // Collapse, Copy, Generals, Error, // Expand,...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/utils/types/file_info.rs
src/utils/types/file_info.rs
use crate::translations::translations_3::{ database_from_file_translation, select_directory_translation, style_from_file_translation, }; use crate::translations::translations_4::select_capture_translation; use crate::translations::types::language::Language; #[derive(Debug, Clone, PartialEq)] pub enum FileInfo { ...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/utils/types/timestamp.rs
src/utils/types/timestamp.rs
#[derive(Clone, Default, Debug, Copy, Eq, PartialEq)] pub struct Timestamp { secs: i64, usecs: i64, } impl Timestamp { pub fn new(secs: i64, usecs: i64) -> Self { Self { secs, usecs } } pub fn secs(&self) -> i64 { self.secs } pub fn to_usecs(self) -> Option<i64> { ...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/utils/types/web_page.rs
src/utils/types/web_page.rs
/// This enum defines the possible web pages to be opened. #[derive(Debug, Clone)] pub enum WebPage { /// Sniffnet's GitHub repository. Repo, // /// Sniffnet's website main page. // Website, /// Sniffnet's website/download page. WebsiteDownload, /// Sniffnet's website/news page. WebsiteN...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/utils/types/mod.rs
src/utils/types/mod.rs
pub mod file_info; pub mod icon; pub mod timestamp; pub mod web_page;
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/networking/manage_packets.rs
src/networking/manage_packets.rs
use std::collections::HashMap; use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; use etherparse::{ ArpHardwareId, EtherType, LaxPacketHeaders, LinkHeader, NetHeaders, TransportHeader, }; use pcap::Address; use crate::Protocol; use crate::networking::types::address_port_pair::AddressPortPair; use crate::networking::type...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
true
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/networking/parse_packets.rs
src/networking/parse_packets.rs
//! Module containing functions executed by the thread in charge of parsing sniffed packets use crate::gui::types::filters::Filters; use crate::location; use crate::mmdb::asn::get_asn; use crate::mmdb::country::get_country; use crate::mmdb::types::mmdb_reader::MmdbReaders; use crate::networking::manage_packets::{ ...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/networking/mod.rs
src/networking/mod.rs
pub mod manage_packets; pub mod parse_packets; pub mod traffic_preview; pub mod types;
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/networking/traffic_preview.rs
src/networking/traffic_preview.rs
use crate::gui::types::filters::Filters; use crate::location; use crate::networking::manage_packets::analyze_headers; use crate::networking::parse_packets::get_sniffable_headers; use crate::networking::types::arp_type::ArpType; use crate::networking::types::capture_context::{CaptureContext, CaptureSource, CaptureType};...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/networking/types/ip_collection.rs
src/networking/types/ip_collection.rs
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; use std::ops::RangeInclusive; use std::str::FromStr; #[derive(Debug, Eq, PartialEq, Clone)] pub(crate) struct IpCollection { ips: Vec<IpAddr>, ranges: Vec<RangeInclusive<IpAddr>>, } impl IpCollection { const SEPARATOR: char = ','; const RANGE_SEPARATOR: char...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/networking/types/data_info_host.rs
src/networking/types/data_info_host.rs
//! Module defining the `DataInfoHost` struct related to hosts. use crate::networking::types::data_info::DataInfo; use crate::networking::types::traffic_type::TrafficType; /// Host-related information. #[derive(Clone, Copy, Default, Debug, Eq, PartialEq, Hash)] pub struct DataInfoHost { /// Incoming and outgoing ...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/networking/types/host_data_states.rs
src/networking/types/host_data_states.rs
use std::collections::BTreeSet; use std::net::IpAddr; use iced::widget::combo_box; use crate::countries::types::country::Country; use crate::networking::types::host::Host; use crate::report::types::search_parameters::SearchParameters; /// Struct to contain all the sets of data related to network hosts /// /// It als...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/networking/types/info_address_port_pair.rs
src/networking/types/info_address_port_pair.rs
//! Module defining the `InfoAddressPortPair` struct, useful to format the output report file and //! to keep track of statistics about the sniffed traffic. use std::cmp::Ordering; use std::collections::HashMap; use crate::Service; use crate::networking::types::arp_type::ArpType; use crate::networking::types::data_re...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false
GyulyVGC/sniffnet
https://github.com/GyulyVGC/sniffnet/blob/a748d0a04dfc6f6c3be206d79c5df4f6beeeab85/src/networking/types/bogon.rs
src/networking/types/bogon.rs
use crate::networking::types::ip_collection::IpCollection; use std::net::IpAddr; pub struct Bogon { pub range: IpCollection, pub description: &'static str, } // IPv4 bogons static THIS_NETWORK: std::sync::LazyLock<Bogon> = std::sync::LazyLock::new(|| Bogon { range: IpCollection::new("0.0.0.0-0.255.255.25...
rust
Apache-2.0
a748d0a04dfc6f6c3be206d79c5df4f6beeeab85
2026-01-04T15:32:49.059067Z
false