This file contains 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
import { useEffect } from 'react'; | |
import OktaSignIn from '@okta/okta-signin-widget'; | |
interface OktaSignInWidgetProps { | |
onSuccess: (tokens: any) => void; | |
onError: (error: Error) => void; | |
} | |
export default function OktaSignInWidget({ | |
onSuccess, |
This file contains 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
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; | |
import { CLIENT } from '../context/catalog'; | |
import { route as _route, isError, assertNever } from '../utils/openapi'; | |
import type { | |
paths as CatalogApi, | |
components as CatalogComponent, | |
} from '../types/api/catalog.gen'; | |
import type { | |
paths as ControlApi, | |
components as ControlComponent, |
This file contains 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
import axios from 'axios'; | |
import type { AxiosInstance } from 'axios'; | |
/** | |
* Represents the type of HTTP methods. | |
*/ | |
export type HttpMethod = | |
| 'get' | |
| 'put' | |
| 'post' |
This file contains 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
/* | |
* Unity Control API | |
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | |
* | |
* The version of the OpenAPI document: 0.1 | |
* | |
* | |
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | |
* https://openapi-generator.tech | |
* Do not edit the class manually. |
This file contains 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
// Accepts any type T as its argument which satisfies 'static lifetime trait bounds. | |
fn generic<T: 'static>(v: T) {} | |
// 1. No references. | |
struct NoReferences(String); | |
// 2. Includes a 'static lifetime reference. | |
struct IncludesStaticRef(&'static str); | |
// 3. Inclues a lifetime reference named 'a |
This file contains 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
fn generic<T>(x: T) where T: 'static { ... } |
This file contains 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
let x: &'static str = "Hello, world."; |
This file contains 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
#![feature(prelude_import)] | |
#[prelude_import] | |
use std::prelude::rust_2021::*; | |
#[macro_use] | |
extern crate std; | |
use pyo3::prelude::*; | |
/// Formats the sum of two numbers as string. | |
fn sum_as_string(a: usize, b: usize) -> PyResult<String> { | |
Ok((a + b).to_string()) | |
} |
This file contains 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
use pyo3::prelude::*; | |
/// Formats the sum of two numbers as string. | |
#[pyfunction] | |
fn sum_as_string(a: usize, b: usize) -> PyResult<String> { | |
Ok((a + b).to_string()) | |
} | |
/// A Python module implemented in Rust. | |
#[pymodule] |
This file contains 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
[build-system] | |
requires = ["maturin>=1.0,<2.0"] | |
build-backend = "maturin" | |
[project] | |
name = "my-first-pyo3" | |
requires-python = ">=3.7" | |
classifiers = [ | |
"Programming Language :: Rust", | |
"Programming Language :: Python :: Implementation :: CPython", |
NewerOlder