pub struct SCShareableContent(/* private fields */);Implementations§
Sourcepub fn get() -> Result<Self, SCError>
pub fn get() -> Result<Self, SCError>
Get shareable content (displays, windows, and applications)
§Examples
use screencapturekit::shareable_content::SCShareableContent;
let content = SCShareableContent::get()?;
println!("Found {} displays", content.displays().len());
println!("Found {} windows", content.windows().len());
println!("Found {} apps", content.applications().len());§Errors
Returns an error if screen recording permission is not granted.
Sourcepub fn with_options() -> SCShareableContentOptions
pub fn with_options() -> SCShareableContentOptions
Create options builder for customizing shareable content retrieval
§Examples
use screencapturekit::shareable_content::SCShareableContent;
let content = SCShareableContent::with_options()
.on_screen_windows_only(true)
.exclude_desktop_windows(true)
.get()?;Sourcepub fn displays(&self) -> Vec<SCDisplay>
pub fn displays(&self) -> Vec<SCDisplay>
Get all available displays
§Examples
use screencapturekit::shareable_content::SCShareableContent;
let content = SCShareableContent::get()?;
for display in content.displays() {
println!("Display: {}x{}", display.width(), display.height());
}Sourcepub fn windows(&self) -> Vec<SCWindow>
pub fn windows(&self) -> Vec<SCWindow>
Get all available windows
§Examples
use screencapturekit::shareable_content::SCShareableContent;
let content = SCShareableContent::get()?;
for window in content.windows() {
if let Some(title) = window.title() {
println!("Window: {}", title);
}
}pub fn applications(&self) -> Vec<SCRunningApplication>
pub fn as_ptr(&self) -> *const c_void
Trait Implementations§
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more