Skip to content

Commit

Permalink
v0.19.7
Browse files Browse the repository at this point in the history
  • Loading branch information
SleeplessOne1917 committed Jun 16, 2024
1 parent 1e2bda0 commit 354a7b4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lemmy-client"
version = "0.19.6"
version = "0.19.7"
edition = "2021"
license = "AGPL-3.0"
authors = ["SleeplessOne1917"]
Expand Down
4 changes: 2 additions & 2 deletions src/lemmy_client_internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cfg_if! {
if #[cfg(target_arch = "wasm32")] {
use gloo_net::http::{Request, RequestBuilder};
use web_sys::wasm_bindgen::UnwrapThrowExt;
pub struct Fetch(ClientOptions);
pub struct Fetch(pub ClientOptions);

impl Fetch {
pub fn new(options: ClientOptions) -> Self {
Expand Down Expand Up @@ -105,7 +105,7 @@ cfg_if! {

pub struct ClientWrapper {
client: reqwest::Client,
options: ClientOptions
pub options: ClientOptions
}

impl ClientWrapper {
Expand Down
16 changes: 15 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
//! assert!(res.is_ok());
//! }
//!
//! ```
//! ## IMPORTANT NOTICE
//! This crate now uses a different versioning scheme than before so as not to be too tied down to Lemmy releases. For Lemmy versions 0.19.4 and up, use versions 1.x.x. For Lemmy versions 0.19.3 and under, use versions 0.19.5 and up. This is confusing, but should become a non issue as Lemmy accumulates versions and fewer servers use Lemmy versions use 0.19.3 and lower
//! ```

use std::collections::HashMap;

use crate::{lemmy_client_trait::LemmyClientInternal, response::LemmyResult};
Expand Down Expand Up @@ -58,6 +59,19 @@ pub struct LemmyClient {
client: ClientWrapper,
}

impl LemmyClient {
/// Get the options the client is using.
pub fn options(&self) -> &ClientOptions {
cfg_if! {
if #[cfg(target_family = "wasm")] {
&self.client.0
} else {
&self.client.options
}
}
}
}

macro_rules! expose_wrapped_fn {
($name:ident, $form:ty, $response:ty, $doc:expr) => {
#[doc = $doc]
Expand Down

0 comments on commit 354a7b4

Please sign in to comment.