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 create() -> SCShareableContentOptions
pub fn create() -> SCShareableContentOptions
Create options builder for customizing shareable content retrieval
§Examples
use screencapturekit::shareable_content::SCShareableContent;
let content = SCShareableContent::create()
.with_on_screen_windows_only(true)
.with_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);
}
}Sourcepub fn applications(&self) -> Vec<SCRunningApplication>
pub fn applications(&self) -> Vec<SCRunningApplication>
Get all available running applications
§Examples
use screencapturekit::shareable_content::SCShareableContent;
let content = SCShareableContent::get()?;
for app in content.applications() {
println!("App: {} (PID: {})", app.application_name(), app.process_id());
}Sourcepub fn current_process() -> Result<Self, SCError>
pub fn current_process() -> Result<Self, SCError>
Get shareable content for the current process only (macOS 14.4+)
This retrieves content that the current process can capture without requiring user authorization via TCC (Transparency, Consent, and Control).
§Errors
Returns an error if retrieval fails.
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