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 |
|---|---|---|---|---|---|---|---|---|
dylibso/modsurfer | https://github.com/dylibso/modsurfer/blob/71ae2ca8e06917b33281bd0b75843ee60edccba8/convert/src/from_api.rs | convert/src/from_api.rs | use crate::*;
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
use crate::types::Audit;
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
use chrono::offset::TimeZone;
use modsurfer_module::{Export, Function, FunctionType, Import, ValType};
pub fn source_language(src: api::SourceLanguag... | rust | Apache-2.0 | 71ae2ca8e06917b33281bd0b75843ee60edccba8 | 2026-01-04T20:22:33.912580Z | false |
dylibso/modsurfer | https://github.com/dylibso/modsurfer/blob/71ae2ca8e06917b33281bd0b75843ee60edccba8/convert/src/lib.rs | convert/src/lib.rs | mod types;
pub use types::{Order, Pagination, Sort, SortField};
pub use types::{Audit, AuditOutcome, Search};
pub(crate) use modsurfer_module::SourceLanguage;
pub use modsurfer_proto_v1::api;
pub mod from_api;
pub mod to_api;
| rust | Apache-2.0 | 71ae2ca8e06917b33281bd0b75843ee60edccba8 | 2026-01-04T20:22:33.912580Z | false |
dylibso/modsurfer | https://github.com/dylibso/modsurfer/blob/71ae2ca8e06917b33281bd0b75843ee60edccba8/convert/src/types.rs | convert/src/types.rs | #[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
use chrono::Utc;
use modsurfer_module::{Export, Import, SourceLanguage};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Order {
Asc,
Desc,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Pagination {
pub offset: u32,
pub... | rust | Apache-2.0 | 71ae2ca8e06917b33281bd0b75843ee60edccba8 | 2026-01-04T20:22:33.912580Z | false |
dylibso/modsurfer | https://github.com/dylibso/modsurfer/blob/71ae2ca8e06917b33281bd0b75843ee60edccba8/convert/src/to_api.rs | convert/src/to_api.rs | use crate::*;
use modsurfer_module::{Export, Import, Module, ValType};
pub fn source_language(src: SourceLanguage) -> api::SourceLanguage {
match src {
SourceLanguage::Unknown => api::SourceLanguage::Unknown,
SourceLanguage::AssemblyScript => api::SourceLanguage::AssemblyScript,
SourceLang... | rust | Apache-2.0 | 71ae2ca8e06917b33281bd0b75843ee60edccba8 | 2026-01-04T20:22:33.912580Z | false |
ntrupin/abstractml | https://github.com/ntrupin/abstractml/blob/69342d60c6000412d6e1a202b92ac600063dde71/experimental/precompiler.rs | experimental/precompiler.rs | use std::process;
use std::env;
use std::io::Write;
use std::fs::File;
use std::io::{BufRead, BufReader};
fn main() {
let args: Vec<String> = env::args().collect();
if args.len() < 2 {
println!("Please enter the aml file that must be compiled.");
process::exit(1);
}
let filename =... | rust | Apache-2.0 | 69342d60c6000412d6e1a202b92ac600063dde71 | 2026-01-04T20:23:30.282616Z | false |
hlsxx/tukai | https://github.com/hlsxx/tukai/blob/c7c380ec133362c2f2e04d6cb9e1e2b77fd411be/src/config.rs | src/config.rs | use ratatui::style::Style;
use rust_embed::RustEmbed;
use std::cell::{Ref, RefCell, RefMut};
use serde::{Deserialize, Serialize};
use std::path::{Path, PathBuf};
use std::{collections::HashMap, fmt::Display, hash::Hash};
use maplit::hashmap;
use ratatui::style::Color;
pub trait ToColor {
/// Converts the `(u8, u8... | rust | MIT | c7c380ec133362c2f2e04d6cb9e1e2b77fd411be | 2026-01-04T20:23:37.632912Z | false |
hlsxx/tukai | https://github.com/hlsxx/tukai/blob/c7c380ec133362c2f2e04d6cb9e1e2b77fd411be/src/app.rs | src/app.rs | use crate::config::TukaiConfig;
use crate::event_handler::{EventHandler, TukaiEvent};
use crate::screens::ActiveScreenEnum;
use crate::screens::repeat::RepeatScreen;
use crate::screens::{Screen, stats::StatsScreen, typing::TypingScreen};
use crate::storage::storage_handler::StorageHandler;
use std::{cell::RefCell, rc::... | rust | MIT | c7c380ec133362c2f2e04d6cb9e1e2b77fd411be | 2026-01-04T20:23:37.632912Z | false |
hlsxx/tukai | https://github.com/hlsxx/tukai/blob/c7c380ec133362c2f2e04d6cb9e1e2b77fd411be/src/helper.rs | src/helper.rs | use std::iter::repeat_n;
use crate::config::TukaiConfig;
use rand::{Rng, seq::SliceRandom};
pub struct Generator;
impl Generator {
/// Loads a list of words from the current language from the configuration.
///
/// This method attempts to read words from the language specified
/// in the provided [`TukaiConf... | rust | MIT | c7c380ec133362c2f2e04d6cb9e1e2b77fd411be | 2026-01-04T20:23:37.632912Z | false |
hlsxx/tukai | https://github.com/hlsxx/tukai/blob/c7c380ec133362c2f2e04d6cb9e1e2b77fd411be/src/event_handler.rs | src/event_handler.rs | use std::time::Duration;
use anyhow::{Result, anyhow};
use ratatui::crossterm::event::{Event, EventStream, KeyEvent};
#[cfg(target_os = "windows")]
use ratatui::crossterm::event::KeyEventKind;
use tokio::sync::mpsc;
use futures::{FutureExt, StreamExt};
/// Represents events generated by the Tukai application.
///
... | rust | MIT | c7c380ec133362c2f2e04d6cb9e1e2b77fd411be | 2026-01-04T20:23:37.632912Z | false |
hlsxx/tukai | https://github.com/hlsxx/tukai/blob/c7c380ec133362c2f2e04d6cb9e1e2b77fd411be/src/main.rs | src/main.rs | mod app;
mod config;
mod file_handler;
mod event_handler;
mod helper;
mod screens;
mod storage;
use anyhow::Result;
use app::Tukai;
use config::TukaiConfigBuilder;
use event_handler::EventHandler;
#[tokio::main]
async fn main() -> Result<()> {
let mut terminal = ratatui::init();
let mut event_handler = EventHand... | rust | MIT | c7c380ec133362c2f2e04d6cb9e1e2b77fd411be | 2026-01-04T20:23:37.632912Z | false |
hlsxx/tukai | https://github.com/hlsxx/tukai/blob/c7c380ec133362c2f2e04d6cb9e1e2b77fd411be/src/file_handler.rs | src/file_handler.rs | use std::{
fs::{File, OpenOptions, create_dir_all},
io::{Read, Write},
path::Path,
};
use anyhow::{Error, Result};
pub struct FileHandler;
impl FileHandler {
/// Opens a file for reading and writing, creating it if it does not exist.
///
/// If the file at the specified path exists, it is opened with rea... | rust | MIT | c7c380ec133362c2f2e04d6cb9e1e2b77fd411be | 2026-01-04T20:23:37.632912Z | false |
hlsxx/tukai | https://github.com/hlsxx/tukai/blob/c7c380ec133362c2f2e04d6cb9e1e2b77fd411be/src/storage/stats.rs | src/storage/stats.rs | use super::stat_helper::StatHelper;
use crate::config::TypingDuration;
use ratatui::{
style::{Color, Style},
text::{Line, Span},
};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
pub struct Stat {
typing_duration: TypingDuration,
average_wpm: usize,
raw_wpm: u... | rust | MIT | c7c380ec133362c2f2e04d6cb9e1e2b77fd411be | 2026-01-04T20:23:37.632912Z | false |
hlsxx/tukai | https://github.com/hlsxx/tukai/blob/c7c380ec133362c2f2e04d6cb9e1e2b77fd411be/src/storage/mod.rs | src/storage/mod.rs | pub mod stat_helper;
pub mod stats;
pub mod storage_handler;
| rust | MIT | c7c380ec133362c2f2e04d6cb9e1e2b77fd411be | 2026-01-04T20:23:37.632912Z | false |
hlsxx/tukai | https://github.com/hlsxx/tukai/blob/c7c380ec133362c2f2e04d6cb9e1e2b77fd411be/src/storage/stat_helper.rs | src/storage/stat_helper.rs | pub struct StatHelper;
impl StatHelper {
/// Calculates raw WPM
pub fn get_calculated_raw_wpm(chars_counter: usize, time_limit: usize) -> usize {
((chars_counter as f64 / 5.0) * 60.0 / time_limit as f64) as usize
}
/// Calculates WPM
pub fn get_calculated_wpm(
chars_counter: usize,
mistakes_coun... | rust | MIT | c7c380ec133362c2f2e04d6cb9e1e2b77fd411be | 2026-01-04T20:23:37.632912Z | false |
hlsxx/tukai | https://github.com/hlsxx/tukai/blob/c7c380ec133362c2f2e04d6cb9e1e2b77fd411be/src/storage/storage_handler.rs | src/storage/storage_handler.rs | use std::{
fmt::{Debug, Display},
path::{Path, PathBuf},
};
use anyhow::Result;
use crate::config::{TukaiLayoutName, TypingDuration};
use crate::file_handler::FileHandler;
use super::stats::Stat;
#[derive(Debug)]
pub struct StorageHandlerError {
message: String,
}
impl Display for StorageHandlerError {
fn ... | rust | MIT | c7c380ec133362c2f2e04d6cb9e1e2b77fd411be | 2026-01-04T20:23:37.632912Z | false |
hlsxx/tukai | https://github.com/hlsxx/tukai/blob/c7c380ec133362c2f2e04d6cb9e1e2b77fd411be/src/screens/stats.rs | src/screens/stats.rs | use std::{cell::RefCell, rc::Rc};
use crate::{
config::{TukaiConfig, TukaiLayoutColorTypeEnum},
screens::{Instruction, InstructionWidget, Screen, ToDark},
storage::{
stats::Stat,
storage_handler::{StatOverview, StorageHandler},
},
};
use ratatui::{
Frame,
crossterm::event::KeyEvent,
layout::{Ali... | rust | MIT | c7c380ec133362c2f2e04d6cb9e1e2b77fd411be | 2026-01-04T20:23:37.632912Z | false |
hlsxx/tukai | https://github.com/hlsxx/tukai/blob/c7c380ec133362c2f2e04d6cb9e1e2b77fd411be/src/screens/repeat.rs | src/screens/repeat.rs | use std::{cell::RefCell, collections::HashSet, rc::Rc};
use ratatui::{
Frame,
crossterm::event::{KeyCode, KeyEvent},
layout::{Alignment, Rect},
style::{Modifier, Style},
text::{Line, Span, Text},
widgets::{Block, BorderType, Borders, Padding, Paragraph, Wrap},
};
use crate::{
config::{TukaiConfig, Tukai... | rust | MIT | c7c380ec133362c2f2e04d6cb9e1e2b77fd411be | 2026-01-04T20:23:37.632912Z | false |
hlsxx/tukai | https://github.com/hlsxx/tukai/blob/c7c380ec133362c2f2e04d6cb9e1e2b77fd411be/src/screens/mod.rs | src/screens/mod.rs | pub mod repeat;
pub mod stats;
pub mod typing;
use std::cell::RefCell;
use std::rc::Rc;
use ratatui::{
Frame,
crossterm::event::KeyEvent,
layout::Rect,
style::{Color, Style, Stylize},
text::{Line, Span, Text},
widgets::{Paragraph, block::Title},
};
use crate::{
config::{TukaiConfig, TukaiLayout, TukaiL... | rust | MIT | c7c380ec133362c2f2e04d6cb9e1e2b77fd411be | 2026-01-04T20:23:37.632912Z | false |
hlsxx/tukai | https://github.com/hlsxx/tukai/blob/c7c380ec133362c2f2e04d6cb9e1e2b77fd411be/src/screens/typing.rs | src/screens/typing.rs | use std::{cell::RefCell, collections::HashSet, rc::Rc};
use ratatui::{
Frame,
crossterm::event::{KeyCode, KeyEvent},
layout::{Alignment, Constraint, Flex, Layout, Rect},
style::{Modifier, Style, Stylize},
text::{Line, Span, Text},
widgets::{Block, BorderType, Borders, Clear, Padding, Paragraph, Wrap},
};
... | rust | MIT | c7c380ec133362c2f2e04d6cb9e1e2b77fd411be | 2026-01-04T20:23:37.632912Z | false |
ivanceras/r2d2-sqlite | https://github.com/ivanceras/r2d2-sqlite/blob/ae6c5ffce0bfdffe199d0470a7df0ff3c676e97d/src/lib.rs | src/lib.rs | #![deny(warnings)]
//! # Sqlite support for the `r2d2` connection pool.
//!
//! Library crate: [r2d2-sqlite](https://crates.io/crates/r2d2-sqlite/)
//!
//! Integrated with: [r2d2](https://crates.io/crates/r2d2)
//! and [rusqlite](https://crates.io/crates/rusqlite)
//!
//! ## Example
//!
//! ```rust,no_run
//! extern cr... | rust | MIT | ae6c5ffce0bfdffe199d0470a7df0ff3c676e97d | 2026-01-04T20:23:38.713984Z | false |
ivanceras/r2d2-sqlite | https://github.com/ivanceras/r2d2-sqlite/blob/ae6c5ffce0bfdffe199d0470a7df0ff3c676e97d/tests/test.rs | tests/test.rs | extern crate r2d2;
extern crate r2d2_sqlite;
extern crate rusqlite;
extern crate tempfile;
use std::sync::mpsc;
use std::thread;
use r2d2::ManageConnection;
use tempfile::TempDir;
use r2d2_sqlite::SqliteConnectionManager;
use rusqlite::Connection;
#[test]
fn test_basic() {
let manager = SqliteConnectionManager:... | rust | MIT | ae6c5ffce0bfdffe199d0470a7df0ff3c676e97d | 2026-01-04T20:23:38.713984Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/settings.rs | src/settings.rs | use crate::player::{AudioBackend, SpotifyPlayerSettings};
use gio::prelude::SettingsExt;
use libadwaita::ColorScheme;
use librespot::playback::config::Bitrate;
const SETTINGS: &str = "dev.diegovsky.Riff";
#[derive(Clone, Debug, Default)]
pub struct WindowGeometry {
pub width: i32,
pub height: i32,
pub is_... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/main.rs | src/main.rs | #[macro_use(clone)]
extern crate glib;
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate log;
extern crate gettextrs;
use app::state::ScreenName;
use futures::channel::mpsc::UnboundedSender;
use gettextrs::*;
use gio::prelude::*;
use gio::ApplicationFlags;
use gio::SimpleAction;
use gtk::prelude::*;
mo... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/dbus/listener.rs | src/dbus/listener.rs | use futures::channel::mpsc::UnboundedSender;
use std::rc::Rc;
use crate::app::{
components::EventListener,
models::{RepeatMode, SongDescription},
state::PlaybackEvent,
AppEvent, AppModel,
};
use super::types::{LoopStatus, PlaybackStatus, TrackMetadata};
#[derive(Debug)]
#[allow(clippy::enum_variant_n... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/dbus/types.rs | src/dbus/types.rs | use std::convert::{Into, TryFrom};
use std::time::Instant;
use zvariant::Type;
use zvariant::{Dict, Signature, Str, Value};
fn boxed_value<'a, V: Into<Value<'a>>>(v: V) -> Value<'a> {
Value::new(v.into())
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LoopStatus {
None,
Track,
Playlist,
}
im... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/dbus/mpris.rs | src/dbus/mpris.rs | #![allow(non_snake_case)]
#![allow(unused_variables)]
use std::collections::HashMap;
use std::convert::TryInto;
use futures::channel::mpsc::UnboundedSender;
use zbus::fdo::{Error, Result};
use zbus::{interface, Interface, SignalContext};
use zvariant::{ObjectPath, Value};
use super::types::*;
use crate::app::models:... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/dbus/mod.rs | src/dbus/mod.rs | use futures::channel::mpsc::{unbounded, UnboundedReceiver, UnboundedSender};
use futures::StreamExt;
use std::rc::Rc;
use std::thread;
use zbus::Connection;
use crate::app::{AppAction, AppModel};
mod mpris;
pub use mpris::*;
mod types;
mod listener;
use listener::*;
#[tokio::main]
async fn dbus_server(
mpris: ... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/dispatch.rs | src/app/dispatch.rs | use futures::channel::mpsc::{unbounded, UnboundedReceiver, UnboundedSender};
use futures::future::BoxFuture;
use futures::future::Future;
use futures::stream::StreamExt;
use std::pin::Pin;
use super::AppAction;
// A wrapper around an MPSC sender to send AppActions synchronously or asynchronously
// It is a trait beca... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/mod.rs | src/app/mod.rs | use crate::settings::RiffSettings;
use crate::PlaybackAction;
use crate::{api::CachedSpotifyClient, player::TokenStore};
use futures::channel::mpsc::UnboundedSender;
use std::rc::Rc;
use std::sync::Arc;
pub mod dispatch;
pub use dispatch::{ActionDispatcher, ActionDispatcherImpl, DispatchLoop, Worker};
pub mod compone... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/loader.rs | src/app/loader.rs | use crate::api::cache::*;
use gdk_pixbuf::{prelude::PixbufLoaderExt, Pixbuf, PixbufLoader};
use isahc::config::Configurable;
use isahc::{AsyncBody, AsyncReadResponseExt, HttpClient, Response};
use std::collections::hash_map::DefaultHasher;
use std::hash::Hasher;
use std::io::{Error, ErrorKind, Write};
// A wrapper to ... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/list_store.rs | src/app/list_store.rs | use gio::prelude::*;
use glib::clone::{Downgrade, Upgrade};
use std::iter::Iterator;
use std::marker::PhantomData;
// A wrapper around a GIO ListStore
// DEPRECATED
pub struct ListStore<GType> {
store: gio::ListStore,
_marker: PhantomData<GType>,
}
pub struct WeakListStore<GType> {
store: <gio::ListStore ... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/credentials.rs | src/app/credentials.rs | use serde::{Deserialize, Serialize};
use secret_service::{EncryptionType, Error, SecretService};
use std::{collections::HashMap, time::SystemTime};
static SPOT_ATTR: &str = "spot_credentials";
// I'm not sure this is the right way to make credentials identifiable, but hey, it works
fn make_attributes() -> HashMap<&'s... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/batch_loader.rs | src/app/batch_loader.rs | use gettextrs::gettext;
use std::sync::Arc;
use crate::api::{SpotifyApiClient, SpotifyApiError};
use crate::app::models::*;
use crate::app::AppAction;
// A wrapper around the Spotify API to load batches of songs from various sources (see below)
#[derive(Clone)]
pub struct BatchLoader {
api: Arc<dyn SpotifyApiClie... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/rng.rs | src/app/rng.rs | use rand::{rngs::SmallRng, RngCore, SeedableRng};
// A random, resizable mapping (i-th element to play => j-th track) used to handle shuffled playlists
// It's lazy: initially we don't compute what index i maps to
// It's resizable: if our playlist grows or shrinks, we have to keep the generated mappings stable
// (we... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/state/login_state.rs | src/app/state/login_state.rs | use gettextrs::*;
use std::borrow::Cow;
use url::Url;
use crate::app::models::PlaylistSummary;
use crate::app::state::{AppAction, AppEvent, UpdatableState};
#[derive(Clone, Debug)]
pub enum TryLoginAction {
Restore,
InitLogin,
CompleteLogin,
}
#[derive(Clone, Debug)]
pub enum LoginAction {
ShowLogin,... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/state/selection_state.rs | src/app/state/selection_state.rs | use std::borrow::Cow;
use std::collections::HashSet;
use crate::app::models::SongDescription;
use crate::app::state::{AppAction, AppEvent, UpdatableState};
#[derive(Clone, Debug)]
pub enum SelectionAction {
Select(Vec<SongDescription>),
Deselect(Vec<String>),
Clear,
}
impl From<SelectionAction> for AppAc... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/state/browser_state.rs | src/app/state/browser_state.rs | use super::{
AppAction, AppEvent, ArtistState, DetailsState, HomeState, PlaylistDetailsState, ScreenName,
SearchState, UpdatableState, UserState,
};
use crate::app::models::*;
use std::borrow::Cow;
use std::iter::Iterator;
// Actions that affect any "screen" that we push over time
#[derive(Clone, Debug)]
pub e... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/state/playback_state.rs | src/app/state/playback_state.rs | use std::borrow::Cow;
use std::time::Instant;
use crate::app::models::*;
use crate::app::state::{AppAction, AppEvent, UpdatableState};
use crate::app::{BatchQuery, LazyRandomIndex, SongsSource};
#[derive(Debug)]
pub struct PlaybackState {
available_devices: Vec<ConnectDevice>,
current_device: Device,
// A... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/state/settings_state.rs | src/app/state/settings_state.rs | use crate::{
app::state::{AppAction, AppEvent, UpdatableState},
settings::RiffSettings,
};
#[derive(Clone, Debug)]
pub enum SettingsAction {
ChangeSettings,
}
impl From<SettingsAction> for AppAction {
fn from(settings_action: SettingsAction) -> Self {
Self::SettingsAction(settings_action)
... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/state/app_state.rs | src/app/state/app_state.rs | use std::borrow::Cow;
use crate::app::models::{PlaylistDescription, PlaylistSummary};
use crate::app::state::{
browser_state::{BrowserAction, BrowserEvent, BrowserState},
login_state::{LoginAction, LoginEvent, LoginState},
playback_state::{PlaybackAction, PlaybackEvent, PlaybackState},
selection_state:... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/state/mod.rs | src/app/state/mod.rs | mod app_model;
mod app_state;
mod browser_state;
mod login_state;
mod pagination;
mod playback_state;
mod screen_states;
mod selection_state;
mod settings_state;
pub use app_model::AppModel;
pub use app_state::*;
pub use browser_state::*;
pub use login_state::*;
pub use playback_state::*;
pub use screen_states::*;
pub... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/state/pagination.rs | src/app/state/pagination.rs | // A structure for batched queries that I introduced before proper batch management
// Still used to load album lists for instance
// Doesn't know how many elements exist in total ahead of time
#[derive(Clone, Debug)]
pub struct Pagination<T>
where
T: Clone,
{
pub data: T,
// The next offset (of things to l... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/state/app_model.rs | src/app/state/app_model.rs | use crate::api::SpotifyApiClient;
use crate::app::{state::*, BatchLoader};
use ref_filter_map::*;
use std::cell::{Ref, RefCell};
use std::sync::Arc;
pub struct AppServices {
pub spotify_api: Arc<dyn SpotifyApiClient + Send + Sync>,
pub batch_loader: BatchLoader,
}
// Two purposes: give access to some services... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/state/screen_states.rs | src/app/state/screen_states.rs | use std::borrow::Cow;
use std::cmp::PartialEq;
use super::{pagination::Pagination, BrowserAction, BrowserEvent, UpdatableState};
use crate::app::models::*;
use crate::app::ListStore;
#[derive(Clone, Debug)]
pub enum ScreenName {
Home,
AlbumDetails(String),
Search,
Artist(String),
PlaylistDetails(S... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/utils.rs | src/app/components/utils.rs | use gtk::prelude::*;
use std::cell::Cell;
use std::rc::Rc;
use std::time::Duration;
#[derive(Clone)]
pub struct Clock {
interval_ms: u32,
source: Rc<Cell<Option<glib::source::SourceId>>>,
}
impl Default for Clock {
fn default() -> Self {
Self::new(1000)
}
}
impl std::fmt::Debug for Clock {
... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/mod.rs | src/app/components/mod.rs | #[macro_export]
macro_rules! resource {
($resource:expr) => {
concat!("/dev/diegovsky/Riff", $resource)
};
}
use gettextrs::*;
use std::cell::RefCell;
use std::collections::HashSet;
use std::future::Future;
use crate::api::SpotifyApiError;
use crate::app::{ActionDispatcher, AppAction, AppEvent};
mod ... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/player_notifier.rs | src/app/components/player_notifier.rs | use std::ops::Deref;
use std::rc::Rc;
use futures::channel::mpsc::UnboundedSender;
use librespot::core::spotify_id::SpotifyId;
use librespot::core::SpotifyUri;
use crate::app::components::EventListener;
use crate::app::state::{
Device, LoginAction, LoginEvent, LoginStartedEvent, PlaybackEvent, SettingsEvent,
};
u... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/labels.rs | src/app/components/labels.rs | use gettextrs::*;
lazy_static! {
// translators: This is part of a contextual menu attached to a single track; this entry allows viewing the album containing a specific track.
pub static ref VIEW_ALBUM: String = gettext("View album");
// translators: This is part of a contextual menu attached to a single ... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/login/login.rs | src/app/components/login/login.rs | use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk::CompositeTemplate;
use std::rc::Rc;
use url::Url;
use crate::app::components::EventListener;
use crate::app::state::{LoginEvent, LoginStartedEvent};
use crate::app::AppEvent;
use super::LoginModel;
mod imp {
use libadwaita::subclass::prelude::AdwWindow... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/login/login_model.rs | src/app/components/login/login_model.rs | use crate::app::state::{LoginAction, TryLoginAction};
use crate::app::ActionDispatcher;
pub struct LoginModel {
dispatcher: Box<dyn ActionDispatcher>,
}
impl LoginModel {
pub fn new(dispatcher: Box<dyn ActionDispatcher>) -> Self {
Self { dispatcher }
}
pub fn try_autologin(&self) {
se... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/login/mod.rs | src/app/components/login/mod.rs | #[allow(clippy::module_inception)]
mod login;
mod login_model;
pub use login::*;
pub use login_model::*;
| rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/playlist_details/playlist_details_model.rs | src/app/components/playlist_details/playlist_details_model.rs | use gettextrs::gettext;
use gio::prelude::*;
use gio::SimpleActionGroup;
use std::cell::Ref;
use std::ops::Deref;
use std::rc::Rc;
use crate::api::SpotifyApiError;
use crate::app::components::{labels, PlaylistModel};
use crate::app::models::*;
use crate::app::state::SelectionContext;
use crate::app::state::{BrowserAct... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/playlist_details/playlist_details.rs | src/app/components/playlist_details/playlist_details.rs | use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk::CompositeTemplate;
use std::rc::Rc;
use super::playlist_header::PlaylistHeaderWidget;
use super::playlist_headerbar::PlaylistHeaderBarWidget;
use super::PlaylistDetailsModel;
use crate::app::components::{
Component, EventListener, Playlist, PlaylistMode... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/playlist_details/mod.rs | src/app/components/playlist_details/mod.rs | #[allow(clippy::module_inception)]
mod playlist_details;
mod playlist_details_model;
mod playlist_header;
mod playlist_headerbar;
pub use playlist_details::*;
pub use playlist_details_model::*;
use gtk::prelude::StaticType;
pub fn expose_widgets() {
playlist_headerbar::PlaylistHeaderBarWidget::static_type();
}
| rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/playlist_details/playlist_header.rs | src/app/components/playlist_details/playlist_header.rs | use crate::app::components::display_add_css_provider;
use gettextrs::gettext;
use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk::{glib, CompositeTemplate};
const CSS_RO_ENTRY: &str = "playlist__title-entry--ro";
mod imp {
use glib::Properties;
use std::cell::{Cell, RefCell};
use super::*;
... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/playlist_details/playlist_headerbar.rs | src/app/components/playlist_details/playlist_headerbar.rs | use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk::CompositeTemplate;
use libadwaita::subclass::prelude::BinImpl;
mod imp {
use super::*;
#[derive(Debug, Default, CompositeTemplate)]
#[template(resource = "/dev/diegovsky/Riff/components/playlist_headerbar.ui")]
pub struct PlaylistHeaderBarW... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/window/mod.rs | src/app/components/window/mod.rs | use gtk::prelude::*;
use std::cell::RefCell;
use std::rc::Rc;
use crate::app::components::EventListener;
use crate::app::{AppEvent, AppModel};
use crate::settings::WindowGeometry;
thread_local! {
static WINDOW_GEOMETRY: RefCell<WindowGeometry> = const { RefCell::new(WindowGeometry {
width: 0, height: 0, i... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/settings/settings_model.rs | src/app/components/settings/settings_model.rs | use crate::app::state::{PlaybackAction, SettingsAction};
use crate::app::{ActionDispatcher, AppModel};
use crate::settings::RiffSettings;
use std::rc::Rc;
pub struct SettingsModel {
app_model: Rc<AppModel>,
dispatcher: Box<dyn ActionDispatcher>,
}
impl SettingsModel {
pub fn new(app_model: Rc<AppModel>, d... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/settings/settings.rs | src/app/components/settings/settings.rs | use crate::app::components::EventListener;
use crate::app::AppEvent;
use crate::settings::RiffSettings;
use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk::CompositeTemplate;
use libadwaita::prelude::*;
use super::SettingsModel;
const SETTINGS: &str = "dev.diegovsky.Riff";
mod imp {
use super::*;
... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/settings/mod.rs | src/app/components/settings/mod.rs | #[allow(clippy::module_inception)]
mod settings;
mod settings_model;
pub use settings::*;
pub use settings_model::*;
| rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/album/album.rs | src/app/components/album/album.rs | use crate::app::components::display_add_css_provider;
use crate::app::dispatch::Worker;
use crate::app::loader::ImageLoader;
use crate::app::models::AlbumModel;
use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk::CompositeTemplate;
use libadwaita::subclass::prelude::BinImpl;
mod imp {
use super::*;
... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/album/mod.rs | src/app/components/album/mod.rs | #[allow(clippy::module_inception)]
mod album;
pub use album::AlbumWidget;
| rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/notification/mod.rs | src/app/components/notification/mod.rs | use crate::app::components::EventListener;
use crate::app::AppEvent;
use gdk::prelude::ToVariant;
use gettextrs::*;
pub struct Notification {
toast_overlay: libadwaita::ToastOverlay,
}
impl Notification {
pub fn new(toast_overlay: libadwaita::ToastOverlay) -> Self {
Self { toast_overlay }
}
f... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/saved_playlists/saved_playlists_model.rs | src/app/components/saved_playlists/saved_playlists_model.rs | use std::cell::Ref;
use std::ops::Deref;
use std::rc::Rc;
use crate::app::models::*;
use crate::app::state::HomeState;
use crate::app::{ActionDispatcher, AppAction, AppModel, BrowserAction, ListStore};
pub struct SavedPlaylistsModel {
app_model: Rc<AppModel>,
dispatcher: Box<dyn ActionDispatcher>,
}
impl Sav... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/saved_playlists/saved_playlists.rs | src/app/components/saved_playlists/saved_playlists.rs | use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk::CompositeTemplate;
use std::rc::Rc;
use super::SavedPlaylistsModel;
use crate::app::components::{AlbumWidget, Component, EventListener};
use crate::app::dispatch::Worker;
use crate::app::models::AlbumModel;
use crate::app::state::LoginEvent;
use crate::app::... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/saved_playlists/mod.rs | src/app/components/saved_playlists/mod.rs | #[allow(clippy::module_inception)]
mod saved_playlists;
mod saved_playlists_model;
pub use saved_playlists::*;
pub use saved_playlists_model::*;
| rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/library/library.rs | src/app/components/library/library.rs | use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk::CompositeTemplate;
use std::rc::Rc;
use super::LibraryModel;
use crate::app::components::utils::wrap_flowbox_item;
use crate::app::components::{AlbumWidget, Component, EventListener};
use crate::app::dispatch::Worker;
use crate::app::models::AlbumModel;
use ... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/library/library_model.rs | src/app/components/library/library_model.rs | use std::cell::Ref;
use std::ops::Deref;
use std::rc::Rc;
use crate::app::models::*;
use crate::app::state::HomeState;
use crate::app::{ActionDispatcher, AppAction, AppModel, BrowserAction, ListStore};
pub struct LibraryModel {
app_model: Rc<AppModel>,
dispatcher: Box<dyn ActionDispatcher>,
}
impl LibraryMod... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/library/mod.rs | src/app/components/library/mod.rs | #[allow(clippy::module_inception)]
mod library;
mod library_model;
pub use library::*;
pub use library_model::*;
| rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/headerbar/widget.rs | src/app/components/headerbar/widget.rs | use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk::CompositeTemplate;
use libadwaita::subclass::prelude::BinImpl;
use crate::app::components::labels;
mod imp {
use super::*;
#[derive(Debug, Default, CompositeTemplate)]
#[template(resource = "/dev/diegovsky/Riff/components/headerbar.ui")]
p... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/headerbar/mod.rs | src/app/components/headerbar/mod.rs | mod widget;
pub use widget::*;
mod component;
pub use component::*;
use glib::prelude::*;
pub fn expose_widgets() {
widget::HeaderBarWidget::static_type();
}
| rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/headerbar/component.rs | src/app/components/headerbar/component.rs | use std::rc::Rc;
use gtk::prelude::*;
use crate::app::{
components::{Component, EventListener, ListenerComponent},
state::{SelectionContext, SelectionEvent},
ActionDispatcher, AppAction, AppEvent, AppModel, BrowserAction, BrowserEvent,
};
use super::widget::HeaderBarWidget;
pub trait HeaderBarModel {
... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/artist_details/artist_details_model.rs | src/app/components/artist_details/artist_details_model.rs | use gio::prelude::*;
use gio::SimpleActionGroup;
use std::ops::Deref;
use std::rc::Rc;
use crate::api::SpotifyApiError;
use crate::app::components::SimpleHeaderBarModel;
use crate::app::components::{labels, PlaylistModel};
use crate::app::models::*;
use crate::app::state::SelectionContext;
use crate::app::state::{
... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/artist_details/mod.rs | src/app/components/artist_details/mod.rs | #[allow(clippy::module_inception)]
mod artist_details;
pub use artist_details::*;
mod artist_details_model;
pub use artist_details_model::*;
| rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/artist_details/artist_details.rs | src/app/components/artist_details/artist_details.rs | use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk::CompositeTemplate;
use std::rc::Rc;
use crate::app::components::{
display_add_css_provider, AlbumWidget, Component, EventListener, Playlist,
};
use crate::app::{models::*, ListStore};
use crate::app::{AppEvent, BrowserEvent, Worker};
use super::ArtistDe... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/details/details_model.rs | src/app/components/details/details_model.rs | use gio::prelude::*;
use gio::SimpleActionGroup;
use std::cell::Ref;
use std::ops::Deref;
use std::rc::Rc;
use crate::api::SpotifyApiError;
use crate::app::components::labels;
use crate::app::components::HeaderBarModel;
use crate::app::components::PlaylistModel;
use crate::app::components::SimpleHeaderBarModel;
use cr... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/details/mod.rs | src/app/components/details/mod.rs | mod album_header;
#[allow(clippy::module_inception)]
mod details;
mod details_model;
mod release_details;
pub use details::Details;
pub use details_model::DetailsModel;
| rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/details/details.rs | src/app/components/details/details.rs | use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk::CompositeTemplate;
use libadwaita::prelude::AdwDialogExt;
use std::rc::Rc;
use super::album_header::AlbumHeaderWidget;
use super::release_details::ReleaseDetailsDialog;
use super::DetailsModel;
use crate::app::components::{
Component, EventListener, Hea... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/details/album_header.rs | src/app/components/details/album_header.rs | use crate::app::components::display_add_css_provider;
use gettextrs::gettext;
use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk::{glib, CompositeTemplate};
mod imp {
use std::cell::Cell;
use super::*;
#[derive(Debug, Default, CompositeTemplate, glib::Properties)]
#[properties(wrapper_type ... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/details/release_details.rs | src/app/components/details/release_details.rs | use gtk::subclass::prelude::*;
use gtk::CompositeTemplate;
use libadwaita::subclass::prelude::*;
use crate::app::components::labels;
mod imp {
use super::*;
#[derive(Debug, Default, CompositeTemplate)]
#[template(resource = "/dev/diegovsky/Riff/components/release_details.ui")]
pub struct ReleaseDeta... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/navigation/home.rs | src/app/components/navigation/home.rs | use gtk::prelude::*;
use crate::app::components::sidebar::SidebarDestination;
use crate::app::components::{Component, EventListener, ScreenFactory};
use crate::app::{AppEvent, BrowserEvent};
pub struct HomePane {
stack: gtk::Stack,
components: Vec<Box<dyn EventListener>>,
}
impl HomePane {
pub fn new(lis... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/navigation/navigation.rs | src/app/components/navigation/navigation.rs | use gtk::prelude::WidgetExt;
use std::rc::Rc;
use crate::app::components::{EventListener, ListenerComponent};
use crate::app::state::ScreenName;
use crate::app::{AppEvent, BrowserEvent};
use super::{factory::ScreenFactory, home::HomePane, NavigationModel};
pub struct Navigation {
model: Rc<NavigationModel>,
... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/navigation/mod.rs | src/app/components/navigation/mod.rs | #[allow(clippy::module_inception)]
mod navigation;
pub use navigation::*;
mod navigation_model;
pub use navigation_model::*;
mod home;
mod factory;
pub use factory::*;
| rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/navigation/navigation_model.rs | src/app/components/navigation/navigation_model.rs | use crate::app::state::ScreenName;
use crate::app::{ActionDispatcher, AppModel, BrowserAction};
use std::ops::Deref;
use std::rc::Rc;
pub struct NavigationModel {
app_model: Rc<AppModel>,
dispatcher: Box<dyn ActionDispatcher>,
}
impl NavigationModel {
pub fn new(app_model: Rc<AppModel>, dispatcher: Box<dy... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/navigation/factory.rs | src/app/components/navigation/factory.rs | use std::rc::Rc;
use crate::app::components::sidebar::{Sidebar, SidebarModel};
use crate::app::components::*;
use crate::app::state::SelectionContext;
use crate::app::{ActionDispatcher, AppModel, Worker};
pub struct ScreenFactory {
app_model: Rc<AppModel>,
dispatcher: Box<dyn ActionDispatcher>,
worker: Wo... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/sidebar/sidebar_item.rs | src/app/components/sidebar/sidebar_item.rs | use gettextrs::gettext;
use glib::Properties;
use gtk::prelude::*;
use gtk::subclass::prelude::*;
use crate::app::models::PlaylistSummary;
const LIBRARY: &str = "library";
const SAVED_TRACKS: &str = "saved_tracks";
const NOW_PLAYING: &str = "now_playing";
const SAVED_PLAYLISTS: &str = "saved_playlists";
const PLAYLIS... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/sidebar/sidebar_row.rs | src/app/components/sidebar/sidebar_row.rs | use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk::CompositeTemplate;
use super::SidebarItem;
impl SidebarRow {
pub fn new(item: SidebarItem) -> Self {
glib::Object::builder().property("item", item).build()
}
}
mod imp {
use super::*;
use glib::Properties;
use std::cell::RefCell... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/sidebar/mod.rs | src/app/components/sidebar/mod.rs | #[allow(clippy::module_inception)]
mod sidebar;
pub use sidebar::*;
mod sidebar_item;
pub use sidebar_item::*;
mod create_playlist;
mod sidebar_row;
| rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/sidebar/sidebar.rs | src/app/components/sidebar/sidebar.rs | use gettextrs::gettext;
use gtk::prelude::*;
use std::rc::Rc;
use super::create_playlist::CreatePlaylistPopover;
use super::{
sidebar_row::SidebarRow, SidebarDestination, SidebarItem, CREATE_PLAYLIST_ITEM,
SAVED_PLAYLISTS_SECTION,
};
use crate::app::models::{AlbumModel, PlaylistSummary};
use crate::app::state:... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/sidebar/create_playlist.rs | src/app/components/sidebar/create_playlist.rs | use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk::CompositeTemplate;
mod imp {
use super::*;
#[derive(Debug, Default, CompositeTemplate)]
#[template(resource = "/dev/diegovsky/Riff/components/create_playlist.ui")]
pub struct CreatePlaylistPopover {
#[template_child]
pub labe... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/device_selector/widget.rs | src/app/components/device_selector/widget.rs | use crate::app::models::{ConnectDevice, ConnectDeviceKind};
use crate::app::state::Device;
use gdk::prelude::FromVariant;
use gettextrs::gettext;
use gio::{Action, SimpleAction, SimpleActionGroup};
use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk::CompositeTemplate;
const ACTIONS: &str = "devices";
const CO... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/device_selector/mod.rs | src/app/components/device_selector/mod.rs | use gtk::prelude::StaticType;
mod component;
pub use component::*;
mod widget;
pub use widget::*;
pub fn expose_widgets() {
widget::DeviceSelectorWidget::static_type();
}
| rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/device_selector/component.rs | src/app/components/device_selector/component.rs | use std::ops::Deref;
use std::rc::Rc;
use gtk::prelude::Cast;
use crate::app::components::{Component, EventListener};
use crate::app::models::ConnectDevice;
use crate::app::state::{Device, LoginEvent, PlaybackAction, PlaybackEvent};
use crate::app::{ActionDispatcher, AppEvent, AppModel};
use super::widget::DeviceSel... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/playback/playback_info.rs | src/app/components/playback/playback_info.rs | use gettextrs::gettext;
use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk::{glib, CompositeTemplate};
mod imp {
use super::*;
#[derive(Debug, Default, CompositeTemplate)]
#[template(resource = "/dev/diegovsky/Riff/components/playback_info.ui")]
pub struct PlaybackInfoWidget {
#[temp... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/playback/mod.rs | src/app/components/playback/mod.rs | mod component;
mod playback_controls;
mod playback_info;
mod playback_widget;
pub use component::*;
use glib::prelude::*;
pub fn expose_widgets() {
playback_widget::PlaybackWidget::static_type();
}
| rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/playback/playback_controls.rs | src/app/components/playback/playback_controls.rs | use gettextrs::gettext;
use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk::{glib, CompositeTemplate};
use crate::app::models::RepeatMode;
mod imp {
use super::*;
#[derive(Debug, Default, CompositeTemplate)]
#[template(resource = "/dev/diegovsky/Riff/components/playback_controls.ui")]
pub s... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/playback/playback_widget.rs | src/app/components/playback/playback_widget.rs | use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk::{glib, CompositeTemplate};
use crate::app::components::display_add_css_provider;
use crate::app::components::utils::{format_duration, Clock, Debouncer};
use crate::app::loader::ImageLoader;
use crate::app::models::RepeatMode;
use crate::app::Worker;
use sup... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/playback/component.rs | src/app/components/playback/component.rs | use std::ops::Deref;
use std::rc::Rc;
use crate::app::components::EventListener;
use crate::app::models::*;
use crate::app::state::{PlaybackAction, PlaybackEvent, ScreenName, SelectionEvent};
use crate::app::{
ActionDispatcher, AppAction, AppEvent, AppModel, AppState, BrowserAction, Worker,
};
use super::playback... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/artist/mod.rs | src/app/components/artist/mod.rs | use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk::CompositeTemplate;
use crate::app::loader::ImageLoader;
use crate::app::models::ArtistModel;
use crate::app::Worker;
mod imp {
use super::*;
#[derive(Debug, Default, CompositeTemplate)]
#[template(resource = "/dev/diegovsky/Riff/components/art... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Diegovsky/riff | https://github.com/Diegovsky/riff/blob/28e5c58658aaee9095b3ed7b6f92bfefeca4baa1/src/app/components/saved_tracks/saved_tracks.rs | src/app/components/saved_tracks/saved_tracks.rs | use gtk::prelude::*;
use gtk::subclass::prelude::*;
use gtk::CompositeTemplate;
use std::rc::Rc;
use super::SavedTracksModel;
use crate::app::components::{Component, EventListener, Playlist};
use crate::app::state::LoginEvent;
use crate::app::{AppEvent, Worker};
use libadwaita::subclass::prelude::BinImpl;
mod imp {
... | rust | MIT | 28e5c58658aaee9095b3ed7b6f92bfefeca4baa1 | 2026-01-04T20:22:28.974811Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.