This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2022 Google LLC. | |
# SPDX-License-Identifier: Apache-2.0 | |
digraph architecture { | |
subgraph cluster_01 { | |
node [shape=plaintext] | |
label = <<b>Legend</b>>; | |
{rank=same; key, key2 } | |
key [label=<<table border="0" cellpadding="2" cellspacing="0" cellborder="0"> | |
<tr><td align="right" port="i1">Requests (internal)</td></tr> | |
<tr><td align="right" port="i2">Response (internal)</td></tr> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2022 Google LLC. | |
// SPDX-License-Identifier: Apache-2.0 | |
trait ToRef<T> { | |
fn to_ref(&self) -> &T; | |
} | |
trait ToRefMut<T>: ToRef<T> { | |
fn to_mut(&mut self) -> &mut T; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "rusterm" | |
version = "0.1.0" | |
edition = "2021" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
crokey = "0.5.1" | |
crossbeam = "0.8.2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "rusterm" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
crokey = "0.5.1" | |
crossbeam = "0.8.2" | |
crossterm = "0.25.0" | |
notify = "5.0.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2022 Google LLC. | |
// SPDX-License-Identifier: Apache-2.0use std::marker::PhantomData; | |
#[derive(PartialEq, Eq, Hash)] | |
pub struct TypedIndex<T>(Index, PhantomData<T>); | |
impl<T> std::fmt::Debug for TypedIndex<T> { | |
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | |
write!(f, "{}[{}]", std::any::type_name::<T>(), self.0) | |
} | |
} | |
impl<T> TypedIndex<T> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <type_traits> | |
#include <functional> | |
#include <numeric> | |
// give the two templates | |
// need to write the variadic template | |
// need to explain what is going on. |