Skip to content

Commit

Permalink
Add documentation to Android glue code
Browse files Browse the repository at this point in the history
  • Loading branch information
complexspaces committed Mar 27, 2023
1 parent 288022e commit 6391be4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions:
contents: read

env:
RUSTFLAGS: -D warnings -D missing_docs -F unused_must_use
RUSTFLAGS: -D warnings -F unused_must_use

jobs:
clippy:
Expand Down
10 changes: 10 additions & 0 deletions src/android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,19 @@ use once_cell::sync::OnceCell;

static GLOBAL: OnceCell<Global> = OnceCell::new();

/// A layer to access the Android runtime which is hosting the current
/// application process.
///
/// Generally this trait should be implemented in your Rust app component's FFI
/// initialization layer.
pub trait Runtime: Send + Sync {
/// Returns a handle to the current process' JVM.
fn java_vm(&self) -> &JavaVM;
/// Returns a reference to the current app's [Context].
///
/// [Context]: <https://developer.android.com/reference/android/content/Context>
fn context(&self) -> &GlobalRef;
/// Returns a reference to the class returned by the current JVM's `getClassLoader` call.
fn class_loader(&self) -> &GlobalRef;
}

Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("../README.md")]
#![warn(missing_docs)]

use rustls::ClientConfig;
use std::sync::Arc;
Expand Down
1 change: 1 addition & 0 deletions src/tests/ffi.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! Thin wrappers ontop the existing test suites that allow them to be ran
//! in the context of a platform-native environment as required by the verifier implementation.
#![allow(missing_docs)]

#[cfg(target_os = "android")]
pub use android::*;
Expand Down

0 comments on commit 6391be4

Please sign in to comment.