Skip to content

Commit

Permalink
chore: export modules
Browse files Browse the repository at this point in the history
  • Loading branch information
ho-229 committed Jun 24, 2024
1 parent d9586e5 commit c6a1260
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 26 deletions.
14 changes: 7 additions & 7 deletions examples/sftp/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ use std::{
};

use rkyv::{Archive, Deserialize, Serialize};
use ssh2::{Session, Sftp};
use ssh2::Sftp;
use thiserror::Error;
use widestring::{u16str, U16String};
use wincs::{
error::CloudErrorKind,
filter::{info, ticket, SyncFilter},
metadata::Metadata,
nt_time::FileTime,
placeholder::ConvertOptions,
placeholder::{ConvertOptions, Placeholder},
placeholder_file::PlaceholderFile,
request::Request,
CloudErrorKind, HydrationType, Placeholder, PopulationType, Registration, SecurityId,
SyncRootIdBuilder, WriteAt,
root::{HydrationType, PopulationType, Registration, SecurityId, Session, SyncRootIdBuilder},
utility::{FileTime, WriteAt},
};

// max should be 65536, this is done both in term-scp and sshfs because it's the
Expand All @@ -38,7 +38,7 @@ pub struct FileBlob {

fn main() {
let tcp = TcpStream::connect(env::var("SERVER").unwrap()).unwrap();
let mut session = Session::new().unwrap();
let mut session = ssh2::Session::new().unwrap();
session.set_blocking(true);
session.set_tcp_stream(tcp);
session.handshake().unwrap();
Expand Down Expand Up @@ -74,7 +74,7 @@ fn main() {

mark_in_sync(Path::new(&client_path), &sftp);

let connection = wincs::Session::new()
let connection = Session::new()
.connect(&client_path, Filter { sftp })
.unwrap();

Expand Down
5 changes: 4 additions & 1 deletion src/filter/ticket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ use windows::{
use crate::{
command::{self, Command, Fallible},
error::CloudErrorKind,
placeholder_file::PlaceholderFile,
request::{RawConnectionKey, RawTransferKey},
sealed, utility, PlaceholderFile, Usn,
sealed,
usn::Usn,
utility,
};

/// A ticket for the [SyncFilter::fetch_data][crate::SyncFilter::fetch_data] callback.
Expand Down
17 changes: 1 addition & 16 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// [Request][crate::Request] and [Placeholder][crate::Placeholder]. Thus, it is not necessary to
/// create and call these structs manually unless you need more granular access.
pub mod command;
mod error;
pub mod error;
/// Contains traits extending common structs from the [std][std].
pub mod ext;
pub mod filter;
Expand All @@ -16,21 +16,6 @@ pub mod root;
pub mod usn;
pub mod utility;

pub use error::CloudErrorKind;
pub use filter::{info, ticket, SyncFilter};
pub use placeholder::Placeholder;
pub use placeholder_file::{BatchCreate, PlaceholderFile};
pub use request::{Process, Request};
pub use root::{
active_roots, is_supported, Connection, HydrationPolicy, HydrationType, PopulationType,
ProtectionMode, Registration, SecurityId, Session, SupportedAttributes, SyncRootId,
SyncRootIdBuilder,
};
pub use usn::Usn;
pub use utility::{ReadAt, WriteAt};

pub use nt_time;

mod sealed {
pub trait Sealed {}
}
2 changes: 1 addition & 1 deletion src/placeholder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use windows::{
},
};

use crate::{metadata::Metadata, Usn};
use crate::{metadata::Metadata, usn::Usn};

/// The type of handle that the placeholder file/directory owns.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
Expand Down
4 changes: 3 additions & 1 deletion src/root/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ use windows::{
},
};

use crate::{utility::ToHString, SyncRootId};
use crate::utility::ToHString;

use super::SyncRootId;

#[derive(Debug, Clone)]
pub struct Registration<'a> {
Expand Down
2 changes: 2 additions & 0 deletions src/utility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ use windows::core::{self, HSTRING};

use crate::sealed;

pub use nt_time::FileTime;

// TODO: add something to convert an Option<T> to a *const T and *mut T

pub(crate) trait ToHString
Expand Down

0 comments on commit c6a1260

Please sign in to comment.