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 |
|---|---|---|---|---|---|---|---|---|
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/src/fut/future/either.rs | actix/src/fut/future/either.rs | use std::{
pin::Pin,
task::{Context, Poll},
};
use futures_util::future::Either;
use crate::{actor::Actor, fut::ActorFuture};
impl<A, B, Act> ActorFuture<Act> for Either<A, B>
where
A: ActorFuture<Act>,
B: ActorFuture<Act, Output = A::Output>,
Act: Actor,
{
type Output = A::Output;
fn po... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/src/fut/future/result.rs | actix/src/fut/future/result.rs | //! Definition of the [`Ready`] (immediately finished) combinator
use std::{
future::Future,
pin::Pin,
task::{self, Poll},
};
// TODO: remove re-export and encourage direct usage of std and/or futures crate types.
pub use futures_util::future::{ready, Ready};
use crate::{actor::Actor, fut::ActorFuture};
... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/src/fut/future/mod.rs | actix/src/fut/future/mod.rs | use std::{
future::Future,
marker::PhantomData,
ops::{Deref, DerefMut},
pin::Pin,
task::{Context, Poll},
time::Duration,
};
pub use map::Map;
use pin_project_lite::pin_project;
pub use then::Then;
pub use timeout::Timeout;
use crate::actor::Actor;
mod either;
mod map;
pub mod result;
mod then... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/src/fut/future/then.rs | actix/src/fut/future/then.rs | use std::{
pin::Pin,
task::{self, Poll},
};
use futures_core::ready;
use pin_project_lite::pin_project;
use crate::{actor::Actor, fut::ActorFuture};
pin_project! {
/// Future for the [`then`](super::ActorFutureExt::then) combinator, chaining computations on the end of
/// another future regardless of... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/src/actors/mod.rs | actix/src/actors/mod.rs | //! Helper actors
pub mod mocker;
| rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/src/actors/mocker.rs | actix/src/actors/mocker.rs | //! Mocking utility actor.
//!
//! This actor wraps any actor, and replaces instances of that actor with
//! mocker actor, which is able to accept all messages which the actor can
//! receive.
//!
//! Mocking is intended to be achieved by using a pattern similar to
//! ```ignore
//! #[cfg(not(test))]
//! type DBClientA... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/tests/test_supervisor.rs | actix/tests/test_supervisor.rs | use std::{
sync::{
atomic::{AtomicUsize, Ordering},
Arc, Mutex,
},
time::Duration,
};
use actix::prelude::*;
use actix_rt::time::sleep;
struct Die;
impl Message for Die {
type Result = ();
}
struct MyActor(Arc<AtomicUsize>, Arc<AtomicUsize>, Arc<AtomicUsize>);
impl Actor for MyActor... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/tests/test_arbiter.rs | actix/tests/test_arbiter.rs | use std::sync::{
atomic::{AtomicUsize, Ordering},
Arc,
};
use actix::prelude::*;
use tokio::sync::oneshot;
#[derive(Debug)]
struct Ping;
impl Message for Ping {
type Result = ();
}
struct MyActor(Arc<AtomicUsize>);
impl Actor for MyActor {
type Context = Context<Self>;
}
impl Handler<Ping> for MyA... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/tests/test_context.rs | actix/tests/test_context.rs | #![cfg(feature = "macros")]
#![allow(clippy::let_unit_value)]
use std::{
pin::Pin,
sync::{
atomic::{AtomicUsize, Ordering},
Arc,
},
task::{Context as StdContext, Poll},
time::Duration,
};
use actix::prelude::*;
use actix_rt::time::{interval_at, sleep, Instant};
use futures_util::st... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/tests/test_connected.rs | actix/tests/test_connected.rs | #![cfg(feature = "macros")]
use std::time::Duration;
use actix::prelude::*;
use actix_rt::time::sleep;
struct MyActor;
impl Actor for MyActor {
type Context = Context<Self>;
fn started(&mut self, ctx: &mut Self::Context) {
ctx.run_interval(Duration::from_millis(100), |_this, ctx| {
if !... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/tests/test_sink.rs | actix/tests/test_sink.rs | #![cfg(feature = "macros")]
use std::{
pin::Pin,
task::{Context, Poll},
};
use actix::{io::SinkWrite, prelude::*};
use bytes::{Buf, Bytes};
use futures_sink::Sink;
use tokio::sync::mpsc;
type ByteSender = mpsc::UnboundedSender<u8>;
struct MySink {
sender: ByteSender,
queue: Vec<Bytes>,
}
// simple ... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/tests/test_messages.rs | actix/tests/test_messages.rs | #![cfg(feature = "macros")]
use std::collections::HashSet;
use actix::prelude::*;
struct SessionActor {
sessions: HashSet<usize>,
}
impl SessionActor {
fn new() -> Self {
Self {
sessions: HashSet::new(),
}
}
fn session_count(&self) -> usize {
self.sessions.len()
... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/tests/test_lifecycle.rs | actix/tests/test_lifecycle.rs | #![allow(clippy::let_unit_value)]
use std::{
sync::{
atomic::{AtomicBool, Ordering},
Arc, Mutex,
},
time::Duration,
};
use actix::prelude::*;
use actix_rt::time::sleep;
use tokio::sync::oneshot::{channel, Sender};
struct MyActor {
started: Arc<AtomicBool>,
stopping: Arc<AtomicBool... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/tests/test_actor.rs | actix/tests/test_actor.rs | #![cfg(feature = "macros")]
use std::{
sync::{
atomic::{AtomicBool, AtomicUsize, Ordering},
mpsc, Arc,
},
thread,
time::Duration,
};
use actix::prelude::*;
use actix_rt::time::{sleep, Instant};
#[derive(Clone, Debug)]
struct Num(usize);
impl Message for Num {
type Result = ();
}
... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/tests/derive.rs | actix/tests/derive.rs | #![cfg(feature = "macros")]
use std::ops::Mul;
use actix::prelude::*;
#[derive(Message)]
#[rtype(result = "()")]
struct Empty;
struct EmptyActor;
impl Actor for EmptyActor {
type Context = Context<Self>;
}
impl Handler<Empty> for EmptyActor {
type Result = ();
fn handle(&mut self, _message: Empty, _c... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/tests/test_atomic_response.rs | actix/tests/test_atomic_response.rs | #![cfg(feature = "macros")]
use std::time::{Duration, Instant};
use actix::{clock::sleep, prelude::*};
use futures_util::stream::StreamExt;
#[derive(Clone, Copy, Message)]
#[rtype(usize)]
struct Num(usize);
struct MyActor(usize);
impl Actor for MyActor {
type Context = Context<Self>;
}
impl Handler<Num> for M... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/tests/test_address.rs | actix/tests/test_address.rs | use std::{
collections::HashSet,
sync::{
atomic::{AtomicUsize, Ordering},
Arc,
},
time::Duration,
};
use actix::{prelude::*, WeakRecipient};
use actix_rt::time::sleep;
#[derive(Debug)]
struct Ping;
impl Message for Ping {
type Result = ();
}
struct MyActor(Arc<AtomicUsize>);
imp... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/tests/test_sync.rs | actix/tests/test_sync.rs | use std::sync::{
atomic::{AtomicUsize, Ordering},
Arc, Condvar, Mutex,
};
use actix::prelude::*;
struct Fibonacci(pub u32);
impl Message for Fibonacci {
type Result = Result<u64, ()>;
}
struct SyncActor {
cond: Arc<Condvar>,
cond_l: Arc<Mutex<bool>>,
counter: Arc<AtomicUsize>,
messages: ... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/tests/test_fut.rs | actix/tests/test_fut.rs | use std::{
sync::{
atomic::{AtomicBool, Ordering},
Arc,
},
time::Duration,
};
use actix::{clock::sleep, prelude::*};
struct MyActor {
timeout: Arc<AtomicBool>,
}
impl Actor for MyActor {
type Context = actix::Context<Self>;
fn started(&mut self, ctx: &mut Self::Context) {
... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/examples/weak_recipient.rs | actix/examples/weak_recipient.rs | //! WeakRecipient example
//!
//! With a weak recipient you can register any client actor's addrs with a
//! service and still get cleaned up correctly when the client actor is
//! stopped. In contrast to a `WeakAddr` the Service is not bound to know
//! exactly which type of client actor is registering itself.
use st... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/examples/weak_addr.rs | actix/examples/weak_addr.rs | //! WeakAddr example
//!
//! With a weak address you can register an client actor's addrs with a
//! service and still get cleaned up correctly when the client actor is
//! stopped. Alternatively you'd have to check if the client's mailbox
//! is still open.
use std::time::{Duration, Instant};
use actix::{prelude::*,... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/examples/ping.rs | actix/examples/ping.rs | use actix::prelude::*;
/// Define `Ping` message
struct Ping(usize);
impl Message for Ping {
type Result = usize;
}
/// Actor
struct MyActor {
count: usize,
}
/// Declare actor and its context
impl Actor for MyActor {
type Context = Context<Self>;
}
/// Handler for `Ping` message
impl Handler<Ping> for... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/examples/ring.rs | actix/examples/ring.rs | //! Ring benchmark inspired by Programming Erlang: Software for a
//! Concurrent World, by Joe Armstrong, Chapter 8.11.2
//!
//! "Write a ring benchmark. Create N processes in a ring. Send a
//! message round the ring M times so that a total of N * M messages
//! get sent. Time how long this takes for different values ... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/examples/mock.rs | actix/examples/mock.rs | //! Mock example
//!
//! Mocking an actor and setting it on the `SystemRegistry`. This can be
//! done so you can test an actor that depends on a `SystemService` in isolation.
#[cfg(test)]
use actix::actors::mocker::Mocker;
use actix::prelude::*;
#[cfg(test)]
use actix::SystemRegistry;
#[derive(Default)]
struct MyActo... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix/examples/fibonacci.rs | actix/examples/fibonacci.rs | //! Example of sync actor. It can be used for cpu bound tasks. Only one sync
//! actor runs within arbiter's thread. Sync actor processes one message at a
//! time. Sync arbiter can start multiple threads with separate instance of
//! actor in each.
use actix::prelude::*;
struct Fibonacci(pub u32);
impl Message for ... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix-derive/src/lib.rs | actix-derive/src/lib.rs | #![deny(rust_2018_idioms, nonstandard_style, future_incompatible)]
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![recursion_limit = "128"]
use proc_macro::TokenStream;
use quote::quote;
use syn::DeriveInput;
... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix-derive/src/message.rs | actix-derive/src/message.rs | use proc_macro2::{Span, TokenStream};
use quote::{quote, ToTokens};
use syn::parse::Parser as _;
type AttributeArgs = syn::punctuated::Punctuated<syn::Meta, syn::Token![,]>;
pub const MESSAGE_ATTR: &str = "rtype";
pub fn expand(ast: &syn::DeriveInput) -> TokenStream {
let item_type = {
match get_attribut... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix-derive/src/message_response.rs | actix-derive/src/message_response.rs | use proc_macro2::TokenStream;
use quote::quote;
use syn::parse_quote;
pub fn expand(ast: &syn::DeriveInput) -> TokenStream {
let name = &ast.ident;
let (_, ty_generics, where_clause) = ast.generics.split_for_impl();
let mut generics = ast.generics.clone();
generics.params.push(parse_quote!(_A: actix:... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix-derive/tests/test_macro.rs | actix-derive/tests/test_macro.rs | use actix::{Actor, Context, Handler, System};
use actix_derive::{Message, MessageResponse};
#[derive(MessageResponse)]
struct Added(usize);
#[derive(MessageResponse)]
struct Subtracted(usize);
#[derive(Message)]
#[rtype(result = "Added")]
struct Sum(usize, usize);
#[derive(Message)]
#[rtype(result = Subtracted)]
st... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix-derive/tests/trybuild.rs | actix-derive/tests/trybuild.rs | /// Proc macro compile tests.
///
/// Only run on MSRV to ensure stable compile errors.
#[rustversion_msrv::msrv]
#[test]
fn compile_macros() {
let t = trybuild::TestCases::new();
t.pass("tests/trybuild/rt-main.rs");
t.pass("tests/trybuild/message-response.rs");
t.pass("tests/trybuild/message.rs");
}
| rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix-derive/tests/trybuild/message-response.rs | actix-derive/tests/trybuild/message-response.rs | use actix::MessageResponse;
#[derive(MessageResponse)]
struct Added(usize);
fn main() {}
| rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix-derive/tests/trybuild/rt-main.rs | actix-derive/tests/trybuild/rt-main.rs | #[actix::main]
async fn main() {
async { 1 }.await;
}
| rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix-derive/tests/trybuild/message.rs | actix-derive/tests/trybuild/message.rs | use actix::prelude::*;
#[derive(MessageResponse)]
struct Added(usize);
#[derive(Message)]
#[rtype(result = "Added")]
struct Sum(usize, usize);
#[derive(Message)]
#[rtype(Added)]
struct SumBareType(usize, usize);
#[derive(Message)]
#[rtype("()")]
struct UnitReturnInString;
#[derive(Default)]
struct Adder;
impl Act... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix-broker/src/subscribe.rs | actix-broker/src/subscribe.rs | //! messages.
use std::any::TypeId;
use actix::{dev::ToEnvelope, prelude::*};
use crate::{
broker::{ArbiterBroker, RegisteredBroker, SystemBroker},
msgs::*,
};
/// The `BrokerSubscribe` trait has functions to register an actor's interest in different
/// messages.
pub trait BrokerSubscribe
where
Self: Ac... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix-broker/src/lib.rs | actix-broker/src/lib.rs | //! A message broker for the Actix actor framework.
//!
//! The `actix_broker` crate contains `SystemService` and `ArbiterService` Brokers that
//! keep track of active subscriptions to different `Messages`. Broker services are
//! automatically started when an actor uses functions from the `BrokerSubscribe` and
//! `B... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix-broker/src/msgs.rs | actix-broker/src/msgs.rs | use std::any::TypeId;
use actix::prelude::*;
pub trait BrokerMsg: Message<Result = ()> + Send + Clone + 'static {}
impl<M> BrokerMsg for M where M: Message<Result = ()> + Send + Clone + 'static {}
#[derive(Message)]
#[rtype(result = "()")]
pub struct SubscribeAsync<M: BrokerMsg>(pub Recipient<M>, pub TypeId);
pub ... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix-broker/src/issue.rs | actix-broker/src/issue.rs | use std::any::TypeId;
use actix::prelude::*;
use crate::{
broker::{ArbiterBroker, RegisteredBroker, SystemBroker},
msgs::*,
};
/// The `BrokerIssue` provides functions to issue messages to subscribers.
///
/// This will not deliver the message to the actor that sent it.
pub trait BrokerIssue
where
Self: ... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix-broker/src/broker.rs | actix-broker/src/broker.rs | use std::{
any::{Any, TypeId},
collections::HashMap,
hash::BuildHasherDefault,
marker::PhantomData,
};
use actix::prelude::*;
use ahash::AHasher;
use log::trace;
use crate::msgs::*;
type TypeMap<A> = HashMap<TypeId, A, BuildHasherDefault<AHasher>>;
#[derive(Default)]
pub struct Broker<T> {
sub_m... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix-broker/tests/general.rs | actix-broker/tests/general.rs | extern crate actix;
extern crate actix_broker;
use std::time::Duration;
use actix::prelude::*;
use actix_broker::{BrokerIssue, BrokerSubscribe, SystemBroker};
#[derive(Clone, Message)]
#[rtype(result = "()")]
struct TestMessageOne(u8);
struct TestActorOne;
struct TestActorTwo;
impl Actor for TestActorOne {
ty... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix-broker/tests/delivery.rs | actix-broker/tests/delivery.rs | extern crate actix;
extern crate actix_broker;
use std::time::Duration;
use actix::{clock::sleep, prelude::*};
use actix_broker::{Broker, BrokerSubscribe, SystemBroker};
#[derive(Clone, Message)]
#[rtype(result = "()")]
struct TestMessage;
#[derive(Default)]
struct TestActor {
count: u8,
}
impl Actor for TestA... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix-broker/benches/broker.rs | actix-broker/benches/broker.rs | use std::{
future::Future,
sync::{
atomic::{AtomicBool, AtomicU16, Ordering},
mpsc::SyncSender,
Arc,
},
thread,
time::Duration,
};
use actix::{Actor, Context, Handler, Message, System};
use actix_broker::{Broker, BrokerSubscribe, SystemBroker};
use criterion::{
criterion... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix-broker/examples/basic.rs | actix-broker/examples/basic.rs | use std::time::Duration;
use actix::prelude::*;
use actix_broker::{BrokerIssue, BrokerSubscribe, SystemBroker};
struct ActorOne;
struct ActorTwo;
struct ActorThree;
type BrokerType = SystemBroker;
impl Actor for ActorOne {
type Context = Context<Self>;
fn started(&mut self, ctx: &mut Self::Context) {
... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
actix/actix | https://github.com/actix/actix/blob/2c5f02d92e2b799d75f726953c21ca6792e977df/actix-broker/examples/actix-web.rs | actix-broker/examples/actix-web.rs | use std::io;
use actix::prelude::*;
use actix_broker::{Broker, BrokerSubscribe, SystemBroker};
use actix_web::{get, App, Error, HttpRequest, HttpResponse, HttpServer};
#[derive(Clone, Debug, Message)]
#[rtype(result = "()")]
struct Hello;
struct TestActor;
impl Actor for TestActor {
type Context = Context<Self>... | rust | Apache-2.0 | 2c5f02d92e2b799d75f726953c21ca6792e977df | 2026-01-04T15:46:08.097085Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/src/prelude.rs | sea-orm-migration/src/prelude.rs | #[cfg(feature = "cli")]
pub use crate::cli;
pub use crate::{
IntoSchemaManagerConnection, MigrationName, MigrationTrait, MigratorTrait, SchemaManager,
SchemaManagerConnection,
};
pub use async_trait;
pub use sea_orm::{
self, ConnectionTrait, DbErr, DeriveIden, DeriveMigrationName,
sea_query::{self, *},... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/src/lib.rs | sea-orm-migration/src/lib.rs | #[cfg(feature = "cli")]
pub mod cli;
pub mod connection;
pub mod manager;
pub mod migrator;
pub mod prelude;
pub mod schema;
pub mod seaql_migrations;
pub mod util;
pub use connection::*;
pub use manager::*;
pub use migrator::*;
pub use async_trait;
pub use sea_orm;
pub use sea_orm::DbErr;
pub use sea_orm::sea_query;... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/src/seaql_migrations.rs | sea-orm-migration/src/seaql_migrations.rs | use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
// One should override the name of migration table via `MigratorTrait::migration_table_name` method
#[sea_orm(table_name = "seaql_migrations")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub versi... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/src/manager.rs | sea-orm-migration/src/manager.rs | use super::{IntoSchemaManagerConnection, SchemaManagerConnection};
use sea_orm::sea_query::{
ForeignKeyCreateStatement, ForeignKeyDropStatement, IndexCreateStatement, IndexDropStatement,
SelectStatement, TableAlterStatement, TableCreateStatement, TableDropStatement,
TableRenameStatement, TableTruncateStatem... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/src/cli.rs | sea-orm-migration/src/cli.rs | use std::future::Future;
use clap::Parser;
use dotenvy::dotenv;
use std::{error::Error, fmt::Display, process::exit};
use tracing_subscriber::{EnvFilter, prelude::*};
use sea_orm::{ConnectOptions, Database, DbConn, DbErr};
use sea_orm_cli::{MigrateSubcommands, run_migrate_generate, run_migrate_init};
use super::Migr... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/src/connection.rs | sea-orm-migration/src/connection.rs | pub use sea_orm::{
DatabaseExecutor as SchemaManagerConnection,
IntoDatabaseExecutor as IntoSchemaManagerConnection,
};
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/src/migrator.rs | sea-orm-migration/src/migrator.rs | mod queries;
use queries::*;
use std::collections::HashSet;
use std::fmt::Display;
use std::future::Future;
use std::pin::Pin;
use std::time::SystemTime;
use tracing::info;
use sea_orm::sea_query::{
Alias, Expr, ExprTrait, ForeignKey, IntoIden, Order, Query, Table, extension::postgres::Type,
};
use sea_orm::{
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/src/util.rs | sea-orm-migration/src/util.rs | pub fn get_file_stem(path: &str) -> &str {
std::path::Path::new(path)
.file_stem()
.map(|f| f.to_str().unwrap())
.unwrap()
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_get_file_stem() {
let pair = vec![
(
"m20220101_000001_create_... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/src/schema.rs | sea-orm-migration/src/schema.rs | //! > Adapted from https://github.com/loco-rs/loco/blob/master/src/schema.rs
//!
//! # Database Table Schema Helpers
//!
//! This module defines functions and helpers for creating database table
//! schemas using the `sea-orm` and `sea-query` libraries.
//!
//! # Example
//!
//! The following example shows how the user... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/src/migrator/queries.rs | sea-orm-migration/src/migrator/queries.rs | use sea_orm::sea_query::{self, Expr, ExprTrait, Query, SelectStatement, SimpleExpr};
use sea_orm::{
ActiveModelTrait, Condition, ConnectionTrait, DbErr, DeriveIden, DynIden, EntityTrait,
};
#[allow(unused_imports)]
use sea_schema::probe::SchemaProbe;
pub fn query_tables<C>(db: &C) -> Result<SelectStatement, DbErr>... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/tests/main.rs | sea-orm-migration/tests/main.rs | mod common;
use common::migrator::*;
use sea_orm::{ConnectOptions, ConnectionTrait, Database, DbBackend, DbErr, Statement};
use sea_orm_migration::{migrator::MigrationStatus, prelude::*};
#[async_std::test]
async fn main() -> Result<(), DbErr> {
tracing_subscriber::fmt()
.with_max_level(tracing::Level::DE... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/tests/postgres.rs | sea-orm-migration/tests/postgres.rs | mod common;
#[cfg(all(test, feature = "sqlx-postgres"))]
mod inner {
use crate::common::migrator::default::*;
use sea_orm::{ConnectOptions, ConnectionTrait, Database, DbBackend, Statement, error::DbErr};
use sea_orm_migration::prelude::*;
#[async_std::test]
async fn test_fresh_with_extension() -> ... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/tests/common/mod.rs | sea-orm-migration/tests/common/mod.rs | pub mod migration;
pub mod migrator;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/tests/common/migrator/override_migration_table_name.rs | sea-orm-migration/tests/common/migrator/override_migration_table_name.rs | use crate::common::migration::*;
use sea_orm_migration::prelude::*;
pub struct Migrator;
#[async_trait::async_trait]
impl MigratorTrait for Migrator {
fn migrations() -> Vec<Box<dyn MigrationTrait>> {
vec![
Box::new(m20220118_000001_create_cake_table::Migration),
Box::new(m20220118... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/tests/common/migrator/default.rs | sea-orm-migration/tests/common/migrator/default.rs | use crate::common::migration::*;
use sea_orm_migration::prelude::*;
pub struct Migrator;
#[async_trait::async_trait]
impl MigratorTrait for Migrator {
fn migrations() -> Vec<Box<dyn MigrationTrait>> {
vec![
Box::new(m20220118_000001_create_cake_table::Migration),
Box::new(m20220118... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/tests/common/migrator/mod.rs | sea-orm-migration/tests/common/migrator/mod.rs | pub mod default;
pub mod override_migration_table_name;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/tests/common/migration/m20220118_000003_seed_cake_table.rs | sea-orm-migration/tests/common/migration/m20220118_000003_seed_cake_table.rs | use sea_orm_migration::prelude::*;
use sea_orm_migration::sea_orm::{entity::*, query::*};
#[derive(DeriveMigrationName)]
pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
let db = manager.get_connection(... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/tests/common/migration/m20220118_000004_create_tea_enum.rs | sea-orm-migration/tests/common/migration/m20220118_000004_create_tea_enum.rs | use sea_orm_migration::prelude::{sea_query::extension::postgres::Type, *};
use sea_orm_migration::sea_orm::{ConnectionTrait, DbBackend};
#[derive(DeriveMigrationName)]
pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), Db... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/tests/common/migration/m20220923_000001_seed_cake_table.rs | sea-orm-migration/tests/common/migration/m20220923_000001_seed_cake_table.rs | use sea_orm_migration::prelude::*;
#[derive(DeriveMigrationName)]
pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
let insert = Query::insert()
.into_table("cake")
.columns(["nam... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/tests/common/migration/m20220118_000002_create_fruit_table.rs | sea-orm-migration/tests/common/migration/m20220118_000002_create_fruit_table.rs | use sea_orm_migration::sea_orm::DbBackend;
use sea_orm_migration::{prelude::*, schema::*};
#[derive(DeriveMigrationName)]
pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.create_tab... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/tests/common/migration/mod.rs | sea-orm-migration/tests/common/migration/mod.rs | pub mod m20220118_000001_create_cake_table;
pub mod m20220118_000002_create_fruit_table;
pub mod m20220118_000003_seed_cake_table;
pub mod m20220118_000004_create_tea_enum;
pub mod m20220923_000001_seed_cake_table;
pub mod m20230109_000001_seed_cake_table;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/tests/common/migration/m20220118_000001_create_cake_table.rs | sea-orm-migration/tests/common/migration/m20220118_000001_create_cake_table.rs | use sea_orm_migration::{prelude::*, schema::*};
#[derive(DeriveMigrationName)]
pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.create_table(
Table::create()
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/sea-orm-migration/tests/common/migration/m20230109_000001_seed_cake_table.rs | sea-orm-migration/tests/common/migration/m20230109_000001_seed_cake_table.rs | use sea_orm_migration::prelude::*;
use sea_orm_migration::sea_orm::{entity::*, query::*};
#[derive(DeriveMigrationName)]
pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
let db = manager.get_connection(... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/1473/src/main.rs | issues/1473/src/main.rs | use sea_orm::{DeriveIden, Iden};
#[derive(DeriveIden)]
enum Character {
Table,
Id,
}
#[derive(DeriveIden)]
struct Glyph;
fn main() {
assert_eq!(Character::Table.to_string(), "character");
assert_eq!(Character::Id.to_string(), "id");
assert_eq!(Glyph.to_string(), "glyph");
}
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/1357/src/entity.rs | issues/1357/src/entity.rs | use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "pool")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: i64,
pub name: String,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}
impl ... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/1357/src/main.rs | issues/1357/src/main.rs | use anyhow::Result;
use sea_orm::{ConnectionTrait, Database, EntityTrait, IntoActiveModel, Schema};
mod entity;
use entity::*;
#[tokio::main]
async fn main() -> Result<()> {
let db = Database::connect("sqlite::memory:").await.unwrap();
let builder = db.get_database_backend();
let schema = Schema::new(bu... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/1790/insert_test.rs | issues/1790/insert_test.rs | mod tests {
// currently ok
#[test]
fn insert_do_nothing_postgres() {
assert_eq!(
Insert::<cake::ActiveModel>::new()
.add(cake::Model {
id: 1,
name: "Apple Pie".to_owned(),
})
.on_conflict(OnConflict:... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/1143/src/main.rs | issues/1143/src/main.rs | mod entity;
#[tokio::main]
async fn main() {}
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/1143/src/entity/sea_orm_active_enums.rs | issues/1143/src/entity/sea_orm_active_enums.rs | use sea_orm::entity::prelude::*;
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum)]
#[sea_orm(rs_type = "String", db_type = "String(StringLen::N(1))")]
pub enum Category {
#[sea_orm(string_value = "B")]
Big,
#[sea_orm(string_value = "S")]
Small,
}
#[derive(Debug, Clone, PartialEq, Eq, ... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/1143/src/entity/mod.rs | issues/1143/src/entity/mod.rs | pub mod sea_orm_active_enums;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/892/src/main.rs | issues/892/src/main.rs | use sea_orm::tests_cfg::{cake, cake_filling};
use sea_orm::{Database, DbErr, EntityTrait, JoinType, QuerySelect, RelationTrait};
#[tokio::main]
async fn main() -> Result<(), DbErr> {
let db = Database::connect("sqlite::memory:").await?;
tokio::spawn(async move {
let _cakes = cake::Entity::find()
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/356/src/model.rs | issues/356/src/model.rs | use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "model", table_iden)]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub owner: String,
pub name: String,
pub description: String,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveR... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/356/src/main.rs | issues/356/src/main.rs | mod model;
pub fn main() {}
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/400/src/model.rs | issues/400/src/model.rs | use sea_orm::entity::prelude::*;
use std::marker::PhantomData;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "model")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: AccountId<String>,
pub name: String,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum R... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/400/src/main.rs | issues/400/src/main.rs | mod model;
pub fn main() {}
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/249/service/src/lib.rs | issues/249/service/src/lib.rs | pub use sea_orm::entity::*;
pub fn clone_a_model<M>(model: &M) -> M
where
M: ModelTrait {
model.clone()
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test() {
println!("OK");
}
} | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/249/app/src/main.rs | issues/249/app/src/main.rs | use service::clone_a_model;
use sea_orm::tests_cfg::cake;
fn main() {
let c1 = cake::Model {
id: 1,
name: "Cheese".to_owned(),
};
let c2 = clone_a_model(&c1);
println!("{:?}", c2);
} | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/630/src/main.rs | issues/630/src/main.rs | use std::collections::HashMap;
// use sea_orm::sea_query::tests_cfg::json;
use sea_orm::{ConnectOptions, Database, EntityTrait};
mod entity;
use entity::{underscores, underscores_workaround};
#[tokio::main]
async fn main() {
let url = option_env!("DATABASE_URL");
if let Some(url) = url {
let opts = C... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/630/src/entity/prelude.rs | issues/630/src/entity/prelude.rs | //! SeaORM Entity. Generated by sea-orm-codegen 0.6.0
pub use super::underscores::Entity as Underscores;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/630/src/entity/underscores_workaround.rs | issues/630/src/entity/underscores_workaround.rs | //! SeaORM Entity. Generated by sea-orm-codegen 0.6.0
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "underscores")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: u32,
#[sea_orm... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/630/src/entity/mod.rs | issues/630/src/entity/mod.rs | //! SeaORM Entity. Generated by sea-orm-codegen 0.6.0
pub mod prelude;
pub mod underscores;
pub mod underscores_workaround;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/630/src/entity/underscores.rs | issues/630/src/entity/underscores.rs | //! SeaORM Entity. Generated by sea-orm-codegen 0.6.0
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "underscores")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: u32,
pub a_b_c... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/1599/graphql/src/query_root.rs | issues/1599/graphql/src/query_root.rs | use crate::OrmDataloader;
use async_graphql::{dataloader::DataLoader, dynamic::*};
use entity::*;
use sea_orm::DatabaseConnection;
use seaography::{Builder, BuilderContext};
lazy_static::lazy_static! { static ref CONTEXT : BuilderContext = BuilderContext :: default () ; }
pub fn schema(
database: DatabaseConnecti... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/1599/graphql/src/main.rs | issues/1599/graphql/src/main.rs | use async_graphql::{
dataloader::DataLoader,
http::{playground_source, GraphQLPlaygroundConfig},
};
use async_graphql_poem::GraphQL;
use dotenv::dotenv;
use lazy_static::lazy_static;
use poem::{get, handler, listener::TcpListener, web::Html, IntoResponse, Route, Server};
use sea_orm::{prelude::*, Database};
use... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/1599/entity/src/lib.rs | issues/1599/entity/src/lib.rs | pub mod cake;
pub mod cake_filling;
pub mod filling;
pub mod fruit;
| rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/1599/entity/src/cake_filling.rs | issues/1599/entity/src/cake_filling.rs | use sea_orm::entity::prelude::*;
#[derive(Copy, Clone, Default, Debug, DeriveEntity)]
pub struct Entity;
impl EntityName for Entity {
fn table_name(&self) -> &'static str {
"cake_filling"
}
}
#[derive(Clone, Debug, PartialEq, Eq, DeriveModel, DeriveActiveModel)]
pub struct Model {
pub cake_id: i3... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/1599/entity/src/cake.rs | issues/1599/entity/src/cake.rs | use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "cake")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
#[sea_orm(column_name = "name", enum_name = "Name")]
pub name: String,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelat... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/1599/entity/src/filling.rs | issues/1599/entity/src/filling.rs | use sea_orm::entity::prelude::*;
#[derive(Copy, Clone, Default, Debug, DeriveEntity)]
#[sea_orm(table_name = "filling")]
pub struct Entity;
#[derive(Clone, Debug, PartialEq, Eq, DeriveModel, DeriveActiveModel)]
pub struct Model {
pub id: i32,
pub name: String,
pub vendor_id: Option<i32>,
#[sea_orm(ign... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/1599/entity/src/fruit.rs | issues/1599/entity/src/fruit.rs | use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "fruit")]
pub struct Model {
#[sea_orm(primary_key)]
#[cfg_attr(feature = "with-json", serde(skip_deserializing))]
pub id: i32,
pub name: String,
pub cake_id: Option<i32>,
}
#[derive(C... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/86/src/cake.rs | issues/86/src/cake.rs | use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "cake")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub name: String,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}
impl ActiveModelBehavior for Acti... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/86/src/main.rs | issues/86/src/main.rs | mod cake;
use sea_orm::*;
#[tokio::main]
pub async fn main() {
tracing_subscriber::fmt()
.with_max_level(tracing::Level::DEBUG)
.with_test_writer()
.init();
let db = Database::connect("mysql://sea:sea@localhost/bakery")
.await
.unwrap();
tokio::spawn(async move {
... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/693/src/content.rs | issues/693/src/content.rs | pub mod prelude {
pub use super::model::{
ActiveModel as ContentActiveModel, Column as ContentColumn, Entity as Content,
Model as ContentModel, PrimaryKey as ContentPrimaryKey, Relation as ContentRelation,
};
}
pub mod model {
use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, Par... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/693/src/container.rs | issues/693/src/container.rs | pub mod prelude {
pub use super::model::{
ActiveModel as ContainerActiveModel, Column as ContainerColumn, Entity as Container,
Model as ContainerModel, PrimaryKey as ContainerPrimaryKey, Relation as ContainerRelation,
};
}
pub mod model {
use sea_orm::entity::prelude::*;
#[derive(Clone... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/693/src/main.rs | issues/693/src/main.rs | mod container;
mod content;
use container::prelude::*;
use content::prelude::*;
use sea_orm::{DbBackend, EntityTrait, QueryTrait};
fn main() {
assert_eq!(
Container::find().find_with_related(Content).build(DbBackend::MySql).to_string(),
[
"SELECT `container`.`db_id` AS `A_db_id`, `cont... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/352/src/ternary_primary_key.rs | issues/352/src/ternary_primary_key.rs | use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "model")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id_1: i32,
#[sea_orm(primary_key, auto_increment = false)]
pub id_2: String,
#[sea_orm(primary_key, auto_inc... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/352/src/binary_primary_key.rs | issues/352/src/binary_primary_key.rs | use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "model")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id_1: i32,
#[sea_orm(primary_key, auto_increment = false)]
pub id_2: String,
pub owner: String,
pub name... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
SeaQL/sea-orm | https://github.com/SeaQL/sea-orm/blob/51dd40b0d126d4745f5429b7be247e44941429de/issues/352/src/quaternary_primary_key.rs | issues/352/src/quaternary_primary_key.rs | use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "model")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id_1: i32,
#[sea_orm(primary_key, auto_increment = false)]
pub id_2: String,
#[sea_orm(primary_key, auto_inc... | rust | Apache-2.0 | 51dd40b0d126d4745f5429b7be247e44941429de | 2026-01-04T15:46:05.431304Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.